T
- the type of the propertypublic final class PropertyModelBuilder<T>
extends java.lang.Object
PropertyModels
.PropertyModel
Modifier and Type | Method and Description |
---|---|
PropertyModel<T> |
build()
Creates the
PropertyModel . |
PropertyModelBuilder<T> |
codec(Codec<T> codec)
Sets a custom codec for the property
|
PropertyModelBuilder<T> |
discriminatorEnabled(boolean discriminatorEnabled)
Enables or disables the use of a discriminator when serializing
|
java.lang.String |
getName() |
PropertyAccessor<T> |
getPropertyAccessor()
Returns the
PropertyAccessor |
PropertySerialization<T> |
getPropertySerialization() |
java.util.List<java.lang.annotation.Annotation> |
getReadAnnotations()
Returns the read annotations, to be applied when serializing to BSON
|
java.lang.String |
getReadName() |
java.util.List<java.lang.annotation.Annotation> |
getWriteAnnotations()
Returns the write annotations, to be applied when deserializing from BSON
|
java.lang.String |
getWriteName() |
java.lang.Boolean |
isDiscriminatorEnabled() |
boolean |
isReadable()
Property is readable.
|
boolean |
isWritable()
Property is writable.
|
PropertyModelBuilder<T> |
propertyAccessor(PropertyAccessor<T> propertyAccessor)
Sets the
PropertyAccessor |
PropertyModelBuilder<T> |
propertySerialization(PropertySerialization<T> propertySerialization)
Sets the
PropertySerialization checker |
PropertyModelBuilder<T> |
readAnnotations(java.util.List<java.lang.annotation.Annotation> annotations)
Sets the read annotations, to be applied when serializing to BSON
|
PropertyModelBuilder<T> |
readName(java.lang.String readName)
Sets the readName, the key for this property when deserializing the data from BSON.
|
java.lang.String |
toString() |
PropertyModelBuilder<T> |
writeAnnotations(java.util.List<java.lang.annotation.Annotation> writeAnnotations)
Sets the writeAnnotations, to be applied when deserializing from BSON
|
PropertyModelBuilder<T> |
writeName(java.lang.String writeName)
Sets the writeName, the key for this property when serializing the data into BSON.
|
public java.lang.String getName()
public java.lang.String getReadName()
public PropertyModelBuilder<T> readName(java.lang.String readName)
Note: A null means this property will not used when deserializing.
readName
- the name of the property to use as the key when deserializing the data from BSON.public java.lang.String getWriteName()
public PropertyModelBuilder<T> writeName(java.lang.String writeName)
Note: A null means this property will not be serialized.
writeName
- the name of the property to use as the key when serializing the data into BSON.public PropertyModelBuilder<T> codec(Codec<T> codec)
codec
- the custom codec for the propertypublic PropertyModelBuilder<T> propertySerialization(PropertySerialization<T> propertySerialization)
PropertySerialization
checkerpropertySerialization
- checks if a property should be serializedpublic PropertySerialization<T> getPropertySerialization()
PropertySerialization
checkerpublic java.util.List<java.lang.annotation.Annotation> getReadAnnotations()
public PropertyModelBuilder<T> readAnnotations(java.util.List<java.lang.annotation.Annotation> annotations)
annotations
- the read annotationspublic java.util.List<java.lang.annotation.Annotation> getWriteAnnotations()
public PropertyModelBuilder<T> writeAnnotations(java.util.List<java.lang.annotation.Annotation> writeAnnotations)
writeAnnotations
- the writeAnnotationspublic boolean isWritable()
public boolean isReadable()
public java.lang.Boolean isDiscriminatorEnabled()
public PropertyModelBuilder<T> discriminatorEnabled(boolean discriminatorEnabled)
discriminatorEnabled
- the useDiscriminator valuepublic PropertyAccessor<T> getPropertyAccessor()
PropertyAccessor
public PropertyModelBuilder<T> propertyAccessor(PropertyAccessor<T> propertyAccessor)
PropertyAccessor
propertyAccessor
- the PropertyAccessorpublic PropertyModel<T> build()
PropertyModel
.public java.lang.String toString()
toString
in class java.lang.Object