Package io.jsondb
Class CollectionMetaData
- java.lang.Object
-
- io.jsondb.CollectionMetaData
-
public class CollectionMetaData extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CollectionMetaData(java.lang.String collectionName, java.lang.Class<?> clazz, java.lang.String schemaVersion, java.util.Comparator<java.lang.String> schemaComparator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,CollectionMetaData>builder(JsonDBConfig dbConfig)A utility builder method to scan through the specified package and find all classes/POJOs that are annotated with the @Document annotation.java.lang.StringgetActualSchemaVersion()java.lang.ClassgetClazz()protected java.util.concurrent.locks.ReentrantReadWriteLockgetCollectionLock()java.lang.StringgetCollectionName()java.lang.reflect.MethodgetGetterMethodForFieldName(java.lang.String fieldName)java.lang.reflect.MethodgetIdAnnotatedFieldGetterMethod()java.lang.StringgetIdAnnotatedFieldName()java.lang.reflect.MethodgetIdAnnotatedFieldSetterMethod()java.lang.StringgetSchemaVersion()java.util.List<java.lang.String>getSecretAnnotatedFieldNames()java.lang.reflect.MethodgetSetterMethodForFieldName(java.lang.String fieldName)booleanhasSecret()booleanisReadOnly()booleanisSecretField(java.lang.String fieldName)voidsetActualSchemaVersion(java.lang.String actualSchemaVersion)
-
-
-
Method Detail
-
getCollectionLock
protected java.util.concurrent.locks.ReentrantReadWriteLock getCollectionLock()
-
getCollectionName
public java.lang.String getCollectionName()
-
getSchemaVersion
public java.lang.String getSchemaVersion()
-
getActualSchemaVersion
public java.lang.String getActualSchemaVersion()
-
setActualSchemaVersion
public void setActualSchemaVersion(java.lang.String actualSchemaVersion)
-
getClazz
public java.lang.Class getClazz()
-
getIdAnnotatedFieldName
public java.lang.String getIdAnnotatedFieldName()
-
getIdAnnotatedFieldGetterMethod
public java.lang.reflect.Method getIdAnnotatedFieldGetterMethod()
-
getIdAnnotatedFieldSetterMethod
public java.lang.reflect.Method getIdAnnotatedFieldSetterMethod()
-
getSecretAnnotatedFieldNames
public java.util.List<java.lang.String> getSecretAnnotatedFieldNames()
-
isSecretField
public boolean isSecretField(java.lang.String fieldName)
-
getGetterMethodForFieldName
public java.lang.reflect.Method getGetterMethodForFieldName(java.lang.String fieldName)
-
getSetterMethodForFieldName
public java.lang.reflect.Method getSetterMethodForFieldName(java.lang.String fieldName)
-
hasSecret
public boolean hasSecret()
-
isReadOnly
public boolean isReadOnly()
-
builder
public static java.util.Map<java.lang.String,CollectionMetaData> builder(JsonDBConfig dbConfig)
A utility builder method to scan through the specified package and find all classes/POJOs that are annotated with the @Document annotation.- Parameters:
dbConfig- the object that holds all the baseScanPackage and other settings.- Returns:
- A Map of collection classes/POJOs
-
-