Package com.jcabi.github
Class Labels.Smart
- java.lang.Object
-
- com.jcabi.github.Labels.Smart
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.github.Labels
Labels.Smart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String name)
Label exists?Label
create(String name, String color)
Create new label.Label
createOrGet(String name)
Create or get label.Label
createOrGet(String name, String color)
Create or get label (with this explicit color).void
delete(String name)
Delete label by name.Label
get(String name)
Get a label by name.Iterable<Label>
iterate()
Iterate them all.Repo
repo()
The repo we're in.
-
-
-
Constructor Detail
-
Smart
public Smart(Labels lbl)
Public ctor.- Parameters:
lbl
- Labels
-
-
Method Detail
-
contains
public boolean contains(String name)
Label exists?- Parameters:
name
- Name of the label- Returns:
- TRUE if it exists
-
createOrGet
public Label createOrGet(String name) throws IOException
Create or get label.- Parameters:
name
- Name of the label- Returns:
- Label found or created
- Throws:
IOException
- If there is any I/O problem
-
createOrGet
public Label createOrGet(String name, String color) throws IOException
Create or get label (with this explicit color).- Parameters:
name
- Name of the labelcolor
- Color to set (or modify)- Returns:
- Label found or created
- Throws:
IOException
- If there is any I/O problem- Since:
- 0.7
-
create
public Label create(String name, String color) throws IOException
Description copied from interface:Labels
Create new label.- Specified by:
create
in interfaceLabels
- Parameters:
name
- The name of itcolor
- Color of it- Returns:
- The label created
- Throws:
IOException
- If there is any I/O problem- See Also:
- Create a Label
-
get
public Label get(String name)
Description copied from interface:Labels
Get a label by name.- Specified by:
get
in interfaceLabels
- Parameters:
name
- The name of it- Returns:
- The label
- See Also:
- Get a single label
-
iterate
public Iterable<Label> iterate()
Description copied from interface:Labels
Iterate them all.- Specified by:
iterate
in interfaceLabels
- Returns:
- Iterator of labels
- See Also:
- List Labels on an Issue
-
delete
public void delete(String name) throws IOException
Description copied from interface:Labels
Delete label by name.- Specified by:
delete
in interfaceLabels
- Parameters:
name
- Name of the label to remove- Throws:
IOException
- If there is any I/O problem- See Also:
- Delete a Label
-
-