Class BaseParameter<T>

    • Field Detail

      • shouldValidate

        protected boolean shouldValidate
    • Constructor Detail

      • BaseParameter

        protected BaseParameter​(String name,
                                String defaultValue)
      • BaseParameter

        protected BaseParameter​(String[] names,
                                String defaultValue)
      • BaseParameter

        protected BaseParameter​(List<String> names,
                                String defaultValue)
    • Method Detail

      • addParameterAlias

        @Deprecated
        public final void addParameterAlias​(String name)
        Deprecated.
        since 3.1: this class is not thread safe and should not be mutated
        Adds the specified String as an alias to the default name of this parameter.
        Parameters:
        name - another name for the parameter recognized by this object
      • setParameterNames

        @Deprecated
        public final void setParameterNames​(String[] names)
        Deprecated.
        since 3.1: this class is not thread safe and should not be mutated
        Sets the specified String array as the names by which to recognize this parameter.
        Parameters:
        names - the names of the parameter to recognize
      • setDefaultValue

        @Deprecated
        public final void setDefaultValue​(String defaultValue)
        Deprecated.
        since 3.1: this class is not thread safe and should not be mutated
        Sets the default value to be returned for this parameter if no match is found in the context.
        Parameters:
        defaultValue - the default value for this parameter
      • getDefaultValue

        public final String getDefaultValue()
        Returns the default value for this parameter if no match is found in the context.
        Returns:
        the default value for this parameter
      • getParameter

        protected final String getParameter​(Map<String,​String> params,
                                            List names,
                                            String defaultValue)
        Returns the literal value of the parameter in the specified Map, using the specified List for names and aliases and the specified default value.
        Parameters:
        params - the Map of parameters to search
        names - the parameter names to look for
        defaultValue - the default value to return if no match is found
        Returns:
        the parameter value, or the default if none is found
      • getParameterValue

        public final String getParameterValue​(Map<String,​String> params)
        Returns the literal value of the parameter, or the default value if none is present.
        Parameters:
        params - the Map of parameters to search
        Returns:
        the literal value of the parameter
      • setValidate

        public final void setValidate​(boolean shouldValidate)
        Description copied from interface: Parameter
        Sets whether this parameter should attempt to validate its values.
        Specified by:
        setValidate in interface Parameter<T>
        Parameters:
        shouldValidate - true if this parameter should attempt to validate