Class OptionsByType.EmptyOptionsByType<T>
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.util.OptionsByType<T>
-
- com.oracle.coherence.concurrent.executor.util.OptionsByType.EmptyOptionsByType<T>
-
- Type Parameters:
T- the type of theOptionsByType
- All Implemented Interfaces:
com.tangosol.io.ExternalizableLite,com.tangosol.io.pof.PortableObject,Serializable
- Enclosing class:
- OptionsByType<T>
protected static final class OptionsByType.EmptyOptionsByType<T> extends OptionsByType<T>
An optimizedOptionsByTypeimplementation for representing emptyOptionsByType.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.oracle.coherence.concurrent.executor.util.OptionsByType
OptionsByType.Default, OptionsByType.EmptyOptionsByType<T>
-
-
Field Summary
Fields Modifier and Type Field Description static OptionsByType.EmptyOptionsByType<?>INSTANCEOptionsByType.EmptyOptionsByTypestatic instance.-
Fields inherited from class com.oracle.coherence.concurrent.executor.util.OptionsByType
m_clzOfOption, m_mapOptionsByType
-
-
Constructor Summary
Constructors Constructor Description EmptyOptionsByType()Constructs anOptionsByType.EmptyOptionsByType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T[]asArray()Obtains the current collection of options as an array.<O extends T>
booleancontains(Class<O> clzOfOption)Determines if an option of the specified concrete type is in the collection.booleancontains(T option)Determines if the specified option (and type) is in theOptionsByType.<U extends T>
Uget(Class<U> clzOfOption)Obtains the option for a specified concrete type from the collection.<U extends T>
Uget(Class<U> clzOfOption, U defaultOption)Obtains the option of a specified concrete type from the collection.voidreadExternal(com.tangosol.io.pof.PofReader in)voidreadExternal(DataInput in)voidwriteExternal(com.tangosol.io.pof.PofWriter out)voidwriteExternal(DataOutput out)-
Methods inherited from class com.oracle.coherence.concurrent.executor.util.OptionsByType
add, addAll, addAll, empty, from, getClassOf, getClassOf, getDefaultFor, toString
-
-
-
-
Field Detail
-
INSTANCE
public static final OptionsByType.EmptyOptionsByType<?> INSTANCE
OptionsByType.EmptyOptionsByTypestatic instance.
-
-
Constructor Detail
-
EmptyOptionsByType
public EmptyOptionsByType()
Constructs anOptionsByType.EmptyOptionsByType.
-
-
Method Detail
-
get
public <U extends T> U get(Class<U> clzOfOption)
Description copied from class:OptionsByTypeObtains 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.Defaultannotation 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,nullis returned.- Overrides:
getin classOptionsByType<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
nullif one can't be determined)
-
get
public <U extends T> U get(Class<U> clzOfOption, U defaultOption)
Description copied from class:OptionsByTypeObtains the option of a specified concrete type from the collection.Should the type of option not exist, the specified default is returned.
- Overrides:
getin classOptionsByType<T>- Type Parameters:
U- the type of value- Parameters:
clzOfOption- the type of option to obtaindefaultOption- 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:OptionsByTypeDetermines if an option of the specified concrete type is in the collection.- Overrides:
containsin classOptionsByType<T>- Type Parameters:
O- the type of option- Parameters:
clzOfOption- the class of option- Returns:
trueif the class of option is in theOptionsByTypefalseotherwise
-
contains
public boolean contains(T option)
Description copied from class:OptionsByTypeDetermines if the specified option (and type) is in theOptionsByType.- Overrides:
containsin classOptionsByType<T>- Parameters:
option- the option- Returns:
trueif the options is defined,falseotherwise
-
asArray
public T[] asArray()
Description copied from class:OptionsByTypeObtains the current collection of options as an array.- Overrides:
asArrayin classOptionsByType<T>- Returns:
- an array of options
-
readExternal
public void readExternal(DataInput in) throws IOException
- Specified by:
readExternalin interfacecom.tangosol.io.ExternalizableLite- Overrides:
readExternalin classOptionsByType<T>- Throws:
IOException
-
writeExternal
public void writeExternal(DataOutput out) throws IOException
- Specified by:
writeExternalin interfacecom.tangosol.io.ExternalizableLite- Overrides:
writeExternalin classOptionsByType<T>- Throws:
IOException
-
readExternal
public void readExternal(com.tangosol.io.pof.PofReader in) throws IOException- Specified by:
readExternalin interfacecom.tangosol.io.pof.PortableObject- Overrides:
readExternalin classOptionsByType<T>- Throws:
IOException
-
writeExternal
public void writeExternal(com.tangosol.io.pof.PofWriter out) throws IOException- Specified by:
writeExternalin interfacecom.tangosol.io.pof.PortableObject- Overrides:
writeExternalin classOptionsByType<T>- Throws:
IOException
-
-