Record Class CommandInfo

java.lang.Object
java.lang.Record
net.apartium.cocoabeans.commands.CommandInfo

@AvailableSince("0.0.30") public record CommandInfo(List<String> descriptions, List<String> usages, List<List<String>> longDescriptions) extends Record
  • Constructor Details

    • CommandInfo

      public CommandInfo(List<String> descriptions, List<String> usages, List<List<String>> longDescriptions)
      Creates an instance of a CommandInfo record class.
      Parameters:
      descriptions - the value for the descriptions record component
      usages - the value for the usages record component
      longDescriptions - the value for the longDescriptions record component
  • Method Details

    • getDescription

      public Optional<String> getDescription()
      Get the first description
      Returns:
      the first description
    • getUsage

      public Optional<String> getUsage()
      Get the first usage
      Returns:
      the first usage
    • getLongDescription

      public Optional<List<String>> getLongDescription()
      Get the first long description
      Returns:
      the first long description
    • getDescriptions

      public List<String> getDescriptions()
      Get all descriptions
      Returns:
      all descriptions
    • getUsages

      public List<String> getUsages()
      Get all usages
      Returns:
      all usages
    • getLongDescriptions

      public List<List<String>> getLongDescriptions()
      Get all long descriptions
      Returns:
      all long descriptions
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • createFromAnnotations

      public static CommandInfo createFromAnnotations(Collection<Annotation[]> collection)
    • merge

      public CommandInfo merge(CommandInfo other)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • descriptions

      public List<String> descriptions()
      Returns the value of the descriptions record component.
      Returns:
      the value of the descriptions record component
    • usages

      public List<String> usages()
      Returns the value of the usages record component.
      Returns:
      the value of the usages record component
    • longDescriptions

      public List<List<String>> longDescriptions()
      Returns the value of the longDescriptions record component.
      Returns:
      the value of the longDescriptions record component