Package org.kohsuke.github
Class GHLabel
- java.lang.Object
-
- org.kohsuke.github.GHLabel
-
public class GHLabel extends Object
The type GHLabel.- Author:
- Kohsuke Kawaguchi
- See Also:
- Labels,
GHIssue#getLabels(),GHRepository#listLabels()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGHLabel.Creatorstatic classGHLabel.SetterAGHLabelBuilderthat updates a single property per requestdone()is called automatically after the property is set.static classGHLabel.UpdaterAGHLabelBuilderthat allows multiple properties to be updated per request.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddelete()Delete this label from the repository.booleanequals(Object o)Equals.StringgetColor()Color code without leading '#', such as 'f29513'.StringgetDescription()Purpose of Label.longgetId()Gets id.StringgetName()Gets name.StringgetNodeId()Gets node id.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.StringgetUrl()Gets url.inthashCode()Hash code.booleanisDefault()If the label is one of the default labels created by GitHub automatically.GHLabel.Setterset()Begins a single property update.voidsetColor(String newColor)voidsetDescription(String newDescription)GHLabel.Updaterupdate()Begins a batch update Consumer must callAbstractBuilder.done()to commit changes.
-
-
-
Method Detail
-
getId
public long getId()
Gets id.- Returns:
- the id
-
getNodeId
public String getNodeId()
Gets node id.- Returns:
- the node id.
-
getColor
@Nonnull public String getColor()
Color code without leading '#', such as 'f29513'.- Returns:
- the color
-
getDescription
@CheckForNull public String getDescription()
Purpose of Label.- Returns:
- the description
-
isDefault
public boolean isDefault()
If the label is one of the default labels created by GitHub automatically.- Returns:
- true if the label is a default one
-
setColor
@Deprecated public void setColor(String newColor) throws IOException
Sets color.- Parameters:
newColor- 6-letter hex color code, like "f29513"- Throws:
IOException- the io exception
-
setDescription
@Deprecated public void setDescription(String newDescription) throws IOException
Sets description.- Parameters:
newDescription- Description of label- Throws:
IOException- the io exception
-
update
@BetaApi public GHLabel.Updater update()
Begins a batch update Consumer must callAbstractBuilder.done()to commit changes.- Returns:
- a
GHLabel.Updater
-
set
@BetaApi public GHLabel.Setter set()
Begins a single property update.- Returns:
- a
GHLabel.Setter
-
delete
public void delete() throws IOExceptionDelete this label from the repository.- Throws:
IOException- the io exception
-
equals
public boolean equals(Object o)
Equals.
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-