Package org.bson.codecs.pojo
Class PropertyModel<T>
-
- org.bson.codecs.pojo.PropertyModel<T>
-
- Type Parameters:
T
- the type of the property that the PropertyModel represents.
public final class PropertyModel<T> extends
Represents a property on a class and stores various metadata such as generic parameters- Since:
- 3.5
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> PropertyModelBuilder<T>
builder()
Create a newPropertyModelBuilder
boolean
o)
Codec<T>
getCodec()
getName()
PropertyAccessor<T>
getPropertyAccessor()
getReadName()
org.bson.codecs.pojo.TypeData<T>
getTypeData()
getWriteName()
int
hashCode()
boolean
isReadable()
Property is readable.boolean
isWritable()
Property is writable.boolean
shouldSerialize(T value)
Returns true if the value should be serialized.toString()
useDiscriminator()
-
-
-
Method Detail
-
builder
public static <T> PropertyModelBuilder<T> builder()
Create a newPropertyModelBuilder
- Type Parameters:
T
- the type of the property- Returns:
- the builder
-
getName
public getName()
- Returns:
- the property name for the model
-
getWriteName
public getWriteName()
- Returns:
- the name of the property to use as the key when deserializing from BSON
-
getReadName
public getReadName()
- Returns:
- the name of the property to use as the key when serializing into BSON
-
isWritable
public boolean isWritable()
Property is writable.- Returns:
- true if can be deserialized from BSON
-
isReadable
public boolean isReadable()
Property is readable.- Returns:
- true if can be serialized to BSON
-
getTypeData
public org.bson.codecs.pojo.TypeData<T> getTypeData()
- Returns:
- the type data for the property
-
shouldSerialize
public boolean shouldSerialize(T value)
Returns true if the value should be serialized.- Parameters:
value
- the value to check- Returns:
- true if the value should be serialized.
-
getPropertyAccessor
public PropertyAccessor<T> getPropertyAccessor()
- Returns:
- the property accessor
-
useDiscriminator
public useDiscriminator()
- Returns:
- true or false if a discriminator should be used when serializing or null if not set
-
toString
public toString()
- Overrides:
in class
-
equals
public boolean equals( o)
- Overrides:
in class
-
hashCode
public int hashCode()
- Overrides:
in class
-
-