Class ExceptionOptionType<T>

  • Type Parameters:
    T - the target type
    Direct Known Subclasses:
    IntegerOptionType, LongOptionType

    public abstract class ExceptionOptionType<T>
    extends OptionType<T>
    Simplify the OptionType class. Implement the accept method. The accept method returns true if there is no exception in parsing the String argument, false otherwise.
    • Constructor Detail

      • ExceptionOptionType

        public ExceptionOptionType()
    • Method Detail

      • accept

        public boolean accept​(String v)
        Description copied from class: OptionType
        Indicate whether this type can accept the value.
        Specified by:
        accept in class OptionType<T>
        Parameters:
        v - the value
        Returns:
        true if can accept, false otherwise