Class Labels.Smart

java.lang.Object
com.jcabi.github.Labels.Smart
All Implemented Interfaces:
Labels
Enclosing interface:
Labels

@Immutable @Loggable(1) public static final class Labels.Smart extends Object implements Labels
Smart Labels with extra features.
Since:
0.5
  • Constructor Details

    • Smart

      public Smart(Labels lbl)
      Public ctor.
      Parameters:
      lbl - Labels
  • Method Details

    • 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 label
      color - Color to set (or modify)
      Returns:
      Label found or created
      Throws:
      IOException - If there is any I/O problem
      Since:
      0.7
    • repo

      public Repo repo()
      Description copied from interface: Labels
      The repo we're in.
      Specified by:
      repo in interface Labels
      Returns:
      Repo
    • create

      public Label create(String name, String color) throws IOException
      Description copied from interface: Labels
      Create new label.
      Specified by:
      create in interface Labels
      Parameters:
      name - The name of it
      color - Color of it
      Returns:
      The label created
      Throws:
      IOException - If there is any I/O problem
      See Also:
    • get

      public Label get(String name)
      Description copied from interface: Labels
      Get a label by name.
      Specified by:
      get in interface Labels
      Parameters:
      name - The name of it
      Returns:
      The label
      See Also:
    • iterate

      public Iterable<Label> iterate()
      Description copied from interface: Labels
      Iterate them all.
      Specified by:
      iterate in interface Labels
      Returns:
      Iterator of labels
      See Also:
    • delete

      public void delete(String name) throws IOException
      Description copied from interface: Labels
      Delete label by name.
      Specified by:
      delete in interface Labels
      Parameters:
      name - Name of the label to remove
      Throws:
      IOException - If there is any I/O problem
      See Also: