public final class ObjectUtils
extends java.lang.Object
A utility class for Object.
| Modifier and Type | Method and Description |
|---|---|
static ObjectFilter |
createUniqueFilter(java.lang.Object object,
java.lang.reflect.Field idField)
Creates unique filter from the object.
|
static <T> java.util.Set<Index> |
extractIndices(NitriteMapper nitriteMapper,
java.lang.Class<T> type)
Extract indices information by scanning for
Index annotated fields. |
static <T> java.lang.String |
findObjectStoreName(java.lang.Class<T> type)
Generates the name of an
ObjectRepository. |
static <T> java.lang.reflect.Field |
getIdField(NitriteMapper nitriteMapper,
java.lang.Class<T> type)
Gets the field marked with
Id annotation. |
static boolean |
isObjectStore(java.lang.String collectionName)
Checks whether a collection name is a valid object store name.
|
static <T> T |
newInstance(java.lang.Class<T> type) |
public static <T> java.lang.String findObjectStoreName(java.lang.Class<T> type)
Generates the name of an ObjectRepository.
T - the type parametertype - the type of object stored in the repositorypublic static <T> java.util.Set<Index> extractIndices(NitriteMapper nitriteMapper, java.lang.Class<T> type)
Extract indices information by scanning for Index annotated fields.
T - the type parameternitriteMapper - the NitriteMappertype - the type of the object stored in the repositoryIndex annotations found.public static <T> java.lang.reflect.Field getIdField(NitriteMapper nitriteMapper, java.lang.Class<T> type)
Gets the field marked with Id annotation.
T - the type parameternitriteMapper - the nitrite mappertype - the typepublic static ObjectFilter createUniqueFilter(java.lang.Object object, java.lang.reflect.Field idField)
Creates unique filter from the object.
object - the objectidField - the id fieldpublic static boolean isObjectStore(java.lang.String collectionName)
Checks whether a collection name is a valid object store name.
collectionName - the collection nametrue if it is a valid object store name; false otherwise.public static <T> T newInstance(java.lang.Class<T> type)