Class OptionMetadata

java.lang.Object
com.github.rvesse.airline.model.OptionMetadata

public class OptionMetadata extends Object
  • Field Details

    • optionType

      private final OptionType optionType
    • options

      private final Set<String> options
    • titles

      private final List<String> titles
    • description

      private final String description
    • arity

      private final int arity
    • hidden

      private final boolean hidden
    • overrides

      private final boolean overrides
    • sealed

      private final boolean sealed
    • restrictions

      private final List<OptionRestriction> restrictions
    • provider

      private final TypeConverterProvider provider
    • accessors

      private Set<Accessor> accessors
  • Constructor Details

  • Method Details

    • getOptionType

      public OptionType getOptionType()
    • getOptions

      public Set<String> getOptions()
    • getTitles

      public List<String> getTitles()
    • getTitle

      @Deprecated public String getTitle()
      Deprecated.
      Options now support multiple titles, use getTitle(int) to get a specific title or getTitles() to get all titles
      Gets the first title
      Returns:
      First title
    • getTitle

      public String getTitle(int index)
    • getDescription

      public String getDescription()
    • getArity

      public int getArity()
    • isRequired

      public boolean isRequired()
    • isHidden

      public boolean isHidden()
    • isOverride

      public boolean isOverride()
    • isSealed

      public boolean isSealed()
    • isMultiValued

      public boolean isMultiValued()
    • getJavaType

      public Class<?> getJavaType()
    • getAccessors

      public Set<Accessor> getAccessors()
    • getRestrictions

      public List<OptionRestriction> getRestrictions()
    • getTypeConverterProvider

      public TypeConverterProvider getTypeConverterProvider()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • override

      public static OptionMetadata override(Set<String> names, OptionMetadata parent, OptionMetadata child)
      Tries to merge the option metadata together such that the child metadata takes precedence. Not all options can be successfully overridden and an error may be thrown in cases where merging is not possible

      The following pieces of metadata may be overridden:

      • Title
      • Description
      • Required
      • Hidden
      Parameters:
      parent - Parent
      child - Child
      Returns:
      Merged metadata