T
- The type of the class the ClassModel representspublic class ClassModelBuilder<T> extends Object
ClassModels
.ClassModel
Modifier and Type | Method | Description |
---|---|---|
ClassModelBuilder<T> |
annotations(List<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(List<Convention> conventions) |
Sets the conventions to apply to the model
|
ClassModelBuilder<T> |
discriminator(String discriminator) |
Sets the discriminator to be used when storing instances of the modeled type
|
ClassModelBuilder<T> |
discriminatorKey(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
|
List<Annotation> |
getAnnotations() |
|
List<Convention> |
getConventions() |
|
String |
getDiscriminator() |
|
String |
getDiscriminatorKey() |
|
String |
getIdPropertyName() |
|
InstanceCreatorFactory<T> |
getInstanceCreatorFactory() |
|
PropertyModelBuilder<?> |
getProperty(String propertyName) |
Gets a property by the property name.
|
List<PropertyModelBuilder<?>> |
getPropertyModelBuilders() |
|
Class<T> |
getType() |
|
ClassModelBuilder<T> |
idPropertyName(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(String propertyName) |
Remove a property from the builder
|
String |
toString() |
|
ClassModelBuilder<T> |
type(Class<T> type) |
Sets the type of the model
|
Boolean |
useDiscriminator() |
public ClassModelBuilder<T> instanceCreatorFactory(InstanceCreatorFactory<T> instanceCreatorFactory)
instanceCreatorFactory
- the InstanceCreatorFactorypublic InstanceCreatorFactory<T> getInstanceCreatorFactory()
public ClassModelBuilder<T> type(Class<T> type)
type
- the type of the classpublic ClassModelBuilder<T> conventions(List<Convention> conventions)
conventions
- a list of conventionspublic List<Convention> getConventions()
public ClassModelBuilder<T> annotations(List<Annotation> annotations)
annotations
- a list of annotationspublic List<Annotation> getAnnotations()
public ClassModelBuilder<T> discriminator(String discriminator)
discriminator
- the discriminator valuepublic String getDiscriminator()
public ClassModelBuilder<T> discriminatorKey(String discriminatorKey)
discriminatorKey
- the discriminator key valuepublic String getDiscriminatorKey()
public ClassModelBuilder<T> enableDiscriminator(boolean discriminatorEnabled)
discriminatorEnabled
- true to enable the use of a discriminatorpublic Boolean useDiscriminator()
public ClassModelBuilder<T> idPropertyName(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 String getIdPropertyName()
_id
property name for this type or null if not setpublic boolean removeProperty(String propertyName)
propertyName
- the actual property name in the POJO and not the documentPropertyName
.public PropertyModelBuilder<?> getProperty(String propertyName)
propertyName
- the name of the property to find.public List<PropertyModelBuilder<?>> getPropertyModelBuilders()
public ClassModel<T> build()