T
- The type of the class the ClassModel representspublic class ClassModelBuilder<T>
extends java.lang.Object
ClassModels
.ClassModel
Modifier and Type | Method and Description |
---|---|
ClassModelBuilder<T> |
annotations(java.util.List<java.lang.annotation.Annotation> annotations)
Sets the annotations for the model
|
ClassModel<T> |
build()
Creates a new ClassModel instance based on the mapping data provided.
|
ClassModelBuilder<T> |
conventions(java.util.List<Convention> conventions)
Sets the conventions to apply to the model
|
ClassModelBuilder<T> |
discriminator(java.lang.String discriminator)
Sets the discriminator to be used when storing instances of the modeled type
|
ClassModelBuilder<T> |
discriminatorKey(java.lang.String discriminatorKey)
Sets the discriminator key to be used when storing instances of the modeled type
|
ClassModelBuilder<T> |
enableDiscriminator(boolean discriminatorEnabled)
Enables or disables the use of a discriminator when serializing
|
java.util.List<java.lang.annotation.Annotation> |
getAnnotations() |
java.util.List<Convention> |
getConventions() |
java.lang.String |
getDiscriminator() |
java.lang.String |
getDiscriminatorKey() |
java.lang.String |
getIdPropertyName() |
InstanceCreatorFactory<T> |
getInstanceCreatorFactory() |
PropertyModelBuilder<?> |
getProperty(java.lang.String propertyName)
Gets a property by the property name.
|
java.util.List<PropertyModelBuilder<?>> |
getPropertyModelBuilders() |
java.lang.Class<T> |
getType() |
ClassModelBuilder<T> |
idPropertyName(java.lang.String idPropertyName)
Designates a property as the
_id property for this type. |
ClassModelBuilder<T> |
instanceCreatorFactory(InstanceCreatorFactory<T> instanceCreatorFactory)
Sets the InstanceCreatorFactory for the ClassModel
|
boolean |
removeProperty(java.lang.String propertyName)
Remove a property from the builder
|
java.lang.String |
toString() |
ClassModelBuilder<T> |
type(java.lang.Class<T> type)
Sets the type of the model
|
java.lang.Boolean |
useDiscriminator() |
public ClassModelBuilder<T> instanceCreatorFactory(InstanceCreatorFactory<T> instanceCreatorFactory)
instanceCreatorFactory
- the InstanceCreatorFactorypublic InstanceCreatorFactory<T> getInstanceCreatorFactory()
public ClassModelBuilder<T> type(java.lang.Class<T> type)
type
- the type of the classpublic java.lang.Class<T> getType()
public ClassModelBuilder<T> conventions(java.util.List<Convention> conventions)
conventions
- a list of conventionspublic java.util.List<Convention> getConventions()
public ClassModelBuilder<T> annotations(java.util.List<java.lang.annotation.Annotation> annotations)
annotations
- a list of annotationspublic java.util.List<java.lang.annotation.Annotation> getAnnotations()
public ClassModelBuilder<T> discriminator(java.lang.String discriminator)
discriminator
- the discriminator valuepublic java.lang.String getDiscriminator()
public ClassModelBuilder<T> discriminatorKey(java.lang.String discriminatorKey)
discriminatorKey
- the discriminator key valuepublic java.lang.String getDiscriminatorKey()
public ClassModelBuilder<T> enableDiscriminator(boolean discriminatorEnabled)
discriminatorEnabled
- true to enable the use of a discriminatorpublic java.lang.Boolean useDiscriminator()
public ClassModelBuilder<T> idPropertyName(java.lang.String idPropertyName)
_id
property for this type. If another property is currently marked as the _id
property, that setting is cleared in favor of the named property.idPropertyName
- the property name to use for the _id
property, a null value removes the set idPropertyName.public java.lang.String getIdPropertyName()
_id
property name for this type or null if not setpublic boolean removeProperty(java.lang.String propertyName)
propertyName
- the actual property name in the POJO and not the documentPropertyName
.public PropertyModelBuilder<?> getProperty(java.lang.String propertyName)
propertyName
- the name of the property to find.public java.util.List<PropertyModelBuilder<?>> getPropertyModelBuilders()
public ClassModel<T> build()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved