Package org.apache.ignite.internal.util
Class GridReflectionCache
- java.lang.Object
-
- org.apache.ignite.internal.util.GridReflectionCache
-
- All Implemented Interfaces:
Externalizable,Serializable
public class GridReflectionCache extends Object implements Externalizable
Reflection field and method cache for classes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_REFLECTION_CACHE_SIZE
-
Constructor Summary
Constructors Constructor Description GridReflectionCache()Reflection cache without any method or field predicates.GridReflectionCache(@Nullable IgnitePredicate<Field> fp, @Nullable IgnitePredicate<Method> mp)Reflection cache with specified field and method predicates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Field>fields(Class<?> cls)Gets fields.@Nullable FieldfirstField(Class<?> cls)Gets first field in the class list of fields.@Nullable ObjectfirstFieldValue(Object o)Gets field value for object.@Nullable MethodfirstMethod(Class<?> cls)Gets first method in the class list of methods.@Nullable ObjectfirstMethodValue(Object o)Gets method return value for object.List<Method>methods(Class<?> cls)Gets methods.voidreadExternal(ObjectInput in)voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
GridReflectionCache
public GridReflectionCache()
Reflection cache without any method or field predicates.
-
GridReflectionCache
public GridReflectionCache(@Nullable @Nullable IgnitePredicate<Field> fp, @Nullable @Nullable IgnitePredicate<Method> mp)Reflection cache with specified field and method predicates.- Parameters:
fp- Field predicate.mp- Method predicate.
-
-
Method Detail
-
firstFieldValue
@Nullable public @Nullable Object firstFieldValue(Object o) throws IgniteCheckedException
Gets field value for object.- Parameters:
o- Key to get affinity key for.- Returns:
- Value of the field for given object or
nullif field was not found. - Throws:
IgniteCheckedException- If failed.
-
firstMethodValue
@Nullable public @Nullable Object firstMethodValue(Object o) throws IgniteCheckedException
Gets method return value for object.- Parameters:
o- Key to get affinity key for.- Returns:
- Method return value for given object or
nullif method was not found. - Throws:
IgniteCheckedException- If failed.
-
firstField
@Nullable public @Nullable Field firstField(Class<?> cls)
Gets first field in the class list of fields.- Parameters:
cls- Class.- Returns:
- First field.
-
firstMethod
@Nullable public @Nullable Method firstMethod(Class<?> cls)
Gets first method in the class list of methods.- Parameters:
cls- Class.- Returns:
- First method.
-
fields
public List<Field> fields(Class<?> cls)
Gets fields.- Parameters:
cls- Class.- Returns:
- Annotated field.
-
methods
public List<Method> methods(Class<?> cls)
Gets methods.- Parameters:
cls- Class.- Returns:
- Annotated method.
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-