T
- the type of the propertypublic final class PropertyModelBuilder<T> extends Object
PropertyModels
.PropertyModel
Modifier and Type | Method | 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
|
String |
getName() |
|
PropertyAccessor<T> |
getPropertyAccessor() |
Returns the
PropertyAccessor |
PropertySerialization<T> |
getPropertySerialization() |
|
List<Annotation> |
getReadAnnotations() |
Returns the read annotations, to be applied when serializing to BSON
|
String |
getReadName() |
|
List<Annotation> |
getWriteAnnotations() |
Returns the write annotations, to be applied when deserializing from BSON
|
String |
getWriteName() |
|
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(List<Annotation> annotations) |
Sets the read annotations, to be applied when serializing to BSON
|
PropertyModelBuilder<T> |
readName(String readName) |
Sets the readName, the key for this property when deserializing the data from BSON.
|
String |
toString() |
|
PropertyModelBuilder<T> |
writeAnnotations(List<Annotation> writeAnnotations) |
Sets the writeAnnotations, to be applied when deserializing from BSON
|
PropertyModelBuilder<T> |
writeName(String writeName) |
Sets the writeName, the key for this property when serializing the data into BSON.
|
public String getName()
public String getReadName()
public PropertyModelBuilder<T> readName(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 String getWriteName()
public PropertyModelBuilder<T> writeName(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 List<Annotation> getReadAnnotations()
public PropertyModelBuilder<T> readAnnotations(List<Annotation> annotations)
annotations
- the read annotationspublic List<Annotation> getWriteAnnotations()
public PropertyModelBuilder<T> writeAnnotations(List<Annotation> writeAnnotations)
writeAnnotations
- the writeAnnotationspublic boolean isWritable()
public boolean isReadable()
public 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
.