Class CustomHooksOption

    • Constructor Detail

      • CustomHooksOption

        protected CustomHooksOption​(OptionManager owner,
                                    String commandline,
                                    String property,
                                    Object defValue,
                                    UserMode minUserMode)
        Initializes the option. Will always output the default value.
        Parameters:
        owner - the owner of this option
        commandline - the commandline string to identify the option
        property - the name of bean property
        defValue - the default value, if null then the owner's current state is used
        minUserMode - the minimum user mode before showing this option
      • CustomHooksOption

        protected CustomHooksOption​(OptionManager owner,
                                    String commandline,
                                    String property,
                                    Object defValue,
                                    boolean outputDefValue,
                                    UserMode minUserMode)
        Initializes the option.
        Parameters:
        owner - the owner of this option
        commandline - the commandline string to identify the option
        property - the name of bean property
        defValue - the default value, if null then the owner's current state is used
        outputDefValue - whether to output the default value or not
        minUserMode - the minimum user mode before showing this option
    • Method Detail

      • compareValues

        protected boolean compareValues​(Object value,
                                        Object defValue)
        Compares the two values.
        Specified by:
        compareValues in class AbstractArgumentOption
        Parameters:
        value - the value to compare against the default value
        defValue - the default value to compare against
        Returns:
        true if both are equal
      • valueOf

        public Object valueOf​(String s)
                       throws Exception
        Turns the string into the appropriate object.

        Needs to be overridden if no custom hook available.
        Specified by:
        valueOf in class AbstractArgumentOption
        Parameters:
        s - the string to parse
        Returns:
        the generated object
        Throws:
        Exception - if parsing of string fails
      • toString

        public String toString​(Object obj)
        Returns a string representation of the specified object.

        Needs to be overridden if no custom hook available. Returns empty string in case the provided object is null.
        Specified by:
        toString in class AbstractArgumentOption
        Parameters:
        obj - the object to turn into a string
        Returns:
        the string representation