Package com.jcabi.github
Class IssueLabels.Smart
java.lang.Object
com.jcabi.github.IssueLabels.Smart
- All Implemented Interfaces:
IssueLabels
- Enclosing interface:
- IssueLabels
@Immutable
@Loggable(1)
public static final class IssueLabels.Smart
extends Object
implements IssueLabels
Smart IssueLabels with extra features.
- Since:
- 0.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.IssueLabels
IssueLabels.Smart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd new labels.booleanaddIfAbsent(String name) Add label if it is absent, don't touch its color if exists.booleanaddIfAbsent(String name, String color) Add label if it is absent, and set its color in any case.voidclear()Remove all labels.booleanLabel exists?findByColor(String color) Select all labels with the given color.Get label by name (runtime exception if absent).issue()The issue we're in.iterate()Iterate them all.voidRemove label by name.booleanremoveIfExists(String name) Remove label if it exists (do nothing otherwise).voidReplace all labels.
-
Constructor Details
-
Smart
Public ctor.- Parameters:
lbl- Labels
-
-
Method Details
-
contains
Label exists?- Parameters:
name- Name of the label- Returns:
- TRUE if it exists
-
get
Get label by name (runtime exception if absent).- Parameters:
name- Name of the label- Returns:
- Label found (exception if not found)
- Since:
- 0.7
-
addIfAbsent
Add label if it is absent, don't touch its color if exists.- Parameters:
name- Name of the label- Returns:
- TRUE if it was added
- Throws:
IOException- If there is any I/O problem
-
addIfAbsent
Add label if it is absent, and set its color in any case.- Parameters:
name- Name of the labelcolor- Color to set- Returns:
- TRUE if it was added
- Throws:
IOException- If there is any I/O problem- Since:
- 0.7
-
findByColor
Select all labels with the given color.- Parameters:
color- Color- Returns:
- Collection of labels with the provided color
- Throws:
IOException- If there is any I/O problem- Since:
- 0.7
-
removeIfExists
Remove label if it exists (do nothing otherwise).- Parameters:
name- Label to remove- Returns:
- TRUE if it was removed, FALSE otherwise
- Throws:
IOException- If there is any I/O problem- Since:
- 0.7
-
issue
Description copied from interface:IssueLabelsThe issue we're in.- Specified by:
issuein interfaceIssueLabels- Returns:
- Issue
-
add
Description copied from interface:IssueLabelsAdd new labels.- Specified by:
addin interfaceIssueLabels- Parameters:
names- The labels to add- Throws:
IOException- If there is any I/O problem- See Also:
-
replace
Description copied from interface:IssueLabelsReplace all labels.- Specified by:
replacein interfaceIssueLabels- Parameters:
names- The labels to save- Throws:
IOException- If there is any I/O problem- See Also:
-
iterate
Description copied from interface:IssueLabelsIterate them all.- Specified by:
iteratein interfaceIssueLabels- Returns:
- Iterator of labels
- See Also:
-
remove
Description copied from interface:IssueLabelsRemove label by name.- Specified by:
removein interfaceIssueLabels- Parameters:
name- Name of the label to remove- Throws:
IOException- If there is any I/O problem- See Also:
-
clear
Description copied from interface:IssueLabelsRemove all labels.- Specified by:
clearin interfaceIssueLabels- Throws:
IOException- If there is any I/O problem- See Also:
-