Class OptionsByType.EmptyOptionsByType<T>

    • Method Detail

      • get

        public <U extends T> U get​(Class<U> clzOfOption)
        Description copied from class: OptionsByType
        Obtains the option for a specified concrete type from the collection.

        Should the option not exist in the collection, an attempt is made to determine a suitable default based on the use of the OptionsByType.Default annotation in the specified class, firstly by looking for and evaluating the annotated "public static U getter()" method, failing that, looking for and evaluating the annotated "public static U value = ...;" field, failing that, looking for an evaluating the annotated public no args constructor and finally, failing that, looking for an annotated field on an enum (assuming the class is an enum). Failing these approaches, null is returned.

        Overrides:
        get in class OptionsByType<T>
        Type Parameters:
        U - the type of value
        Parameters:
        clzOfOption - the concrete type of option to obtain
        Returns:
        the option of the specified type or if undefined, the suitable default value (or null if one can't be determined)
      • get

        public <U extends T> U get​(Class<U> clzOfOption,
                                   U defaultOption)
        Description copied from class: OptionsByType
        Obtains the option of a specified concrete type from the collection.

        Should the type of option not exist, the specified default is returned.

        Overrides:
        get in class OptionsByType<T>
        Type Parameters:
        U - the type of value
        Parameters:
        clzOfOption - the type of option to obtain
        defaultOption - the option to return if the specified type is not defined
        Returns:
        the option of the specified type or the default if it's not defined
      • contains

        public <O extends T> boolean contains​(Class<O> clzOfOption)
        Description copied from class: OptionsByType
        Determines if an option of the specified concrete type is in the collection.
        Overrides:
        contains in class OptionsByType<T>
        Type Parameters:
        O - the type of option
        Parameters:
        clzOfOption - the class of option
        Returns:
        true if the class of option is in the OptionsByType false otherwise
      • contains

        public boolean contains​(T option)
        Description copied from class: OptionsByType
        Determines if the specified option (and type) is in the OptionsByType.
        Overrides:
        contains in class OptionsByType<T>
        Parameters:
        option - the option
        Returns:
        true if the options is defined, false otherwise
      • asArray

        public T[] asArray()
        Description copied from class: OptionsByType
        Obtains the current collection of options as an array.
        Overrides:
        asArray in class OptionsByType<T>
        Returns:
        an array of options
      • readExternal

        public void readExternal​(com.tangosol.io.pof.PofReader in)
                          throws IOException
        Specified by:
        readExternal in interface com.tangosol.io.pof.PortableObject
        Overrides:
        readExternal in class OptionsByType<T>
        Throws:
        IOException
      • writeExternal

        public void writeExternal​(com.tangosol.io.pof.PofWriter out)
                           throws IOException
        Specified by:
        writeExternal in interface com.tangosol.io.pof.PortableObject
        Overrides:
        writeExternal in class OptionsByType<T>
        Throws:
        IOException