/** * Takes a set of labels represented as a string and parses them out. * * @param labelsString a String containing labels separated by LabelsField#SEPARATOR_CHAR * @return a Set of Label */ public static Set<Label> buildFromString(String labelsString) { return buildFromString(new StringToLabel(), labelsString); }
@Override public Set<Label> load(final CacheKey key) { return CachingLabelStore.this.delegateStore.getLabels(key.getIssueId(), key.getFieldId()); } }
@Override public String apply(Label from) { return from.getLabel(); } });
private Label addIfNotContains(final Issue issue, final String label, Long customFieldId, final ApplicationUser remoteUser, final boolean sendNotification) { Set<Label> oldLabels = labelStore.getLabels(issue.getId(), customFieldId); if (containsLabel(label, oldLabels)) { return getLabel(label, oldLabels); } else { final Label newLabel = labelStore.addLabel(issue.getId(), customFieldId, label); issueUpdated(newLabel, oldLabels, issue, customFieldId, remoteUser, sendNotification); return newLabel; } }
public AlphabeticalLabelGroupingSupport(Set<String> labels) { this.data = labels; fillBuckets(); mergeBuckets(); }
private void issueUpdated(final Label label, final Set<Label> oldLabels, final Issue originalIssue, final Long customFieldId, final ApplicationUser remoteUser, final boolean sendNotification) { issueUpdated(joinLabels(label, oldLabels), oldLabels, originalIssue, customFieldId, remoteUser, sendNotification); }
public Label create(String labelName) { return new Label(null, null, null, labelName); } }
public void removeLabel(final Long labelId, final Long issueId, final Long customFieldId) { final CacheKey key = new CacheKey(issueId, customFieldId); try { delegateStore.removeLabel(labelId, issueId, customFieldId); //clear the cache so that the next read will fix up the cache again. } finally { cache.remove(key); } }
@Override public Set<String> getSuggestedLabels(final ApplicationUser user, final Long issueId, final String token) { return getSuggestions(user, issueId, DocumentConstants.ISSUE_LABELS, token); }
private String resolveFieldName(Long customFieldId) { if (customFieldId == null) { return IssueFieldConstants.LABELS; } else { return getFromCustomField(customFieldId); } }
private void validateLabels(final Set<String> labels) { for (String theLabel : labels) { validateSingleLabel(theLabel); } }
@Override public String apply(Label from) { return from.getLabel(); } }));
@Override public String apply(Label from) { return from.getLabel(); } });
@Override public String getStringFromSingularObject(final Label singularObject) { if (singularObject == null) { return null; } return singularObject.getLabel(); }
public String apply(Label label) { return label.getLabel(); } }
@Override public String get(final Label input) { return input.getLabel(); } }));
@Override protected String convertToString(final Label value) { return value.getLabel(); }
public String apply(final Label from) { return from.getLabel(); } });