Interface CliProperty<V>

    • Method Detail

      • getName

        default String getName()
        Returns:
        the canonical name of this CliProperty.
      • getNames

        List<String> getNames()
        Returns:
        the List with the names of this property (e.g. "--help" and "-h" for a CliOption or "file" for a parameter CliValue). The first name from the List is the canonical name. Options may have additional names (aliases) while parameters must have exactly one name.
      • isOption

        boolean isOption()
        Returns:
        true if this CliProperty is an option (corresponds to a CliOption), false otherwise (if a parameter).
      • getValueClass

        Class<V> getValueClass()
        Returns:
        the Class reflecting the type of the value.
      • isMandatory

        boolean isMandatory()
        Returns:
        true if required, false otherwise.
      • isValid

        default boolean isValid()
        Returns:
        true if the value of this property is valid, false otherwise.
      • isEmpty

        default boolean isEmpty()
        Returns:
        true if the value of this property is empty (e.g. null), false otherwise.
      • get

        V get()
        Returns:
        the current value.
      • set

        void set​(V value)
        Parameters:
        value - the new value.
      • setFromString

        void setFromString​(String value)
        Parameters:
        value - the new value as String to parse.
      • validate

        default void validate()
        Validates the value of this property.
        Throws:
        RuntimeException - if the value is invalid.