Class Immutability
- java.lang.Object
-
- org.hibernate.type.descriptor.java.Immutability
-
- All Implemented Interfaces:
Serializable
,MutabilityPlan<Object>
public class Immutability extends Object implements MutabilityPlan<Object>
Object-typed form ofImmutableMutabilityPlan
for easier use withMutability
for users- See Also:
Immutable
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Immutability
INSTANCE
Singleton access
-
Constructor Summary
Constructors Constructor Description Immutability()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
assemble(Serializable cached, SharedSessionContract session)
Assemble a previously disassembled value.Object
deepCopy(Object value)
Return a deep copy of the value.Serializable
disassemble(Object value, SharedSessionContract session)
Return a disassembled representation of the value.static <X> MutabilityPlan<X>
instance()
boolean
isMutable()
Can the internal state of instances ofT
be changed?
-
-
-
Field Detail
-
INSTANCE
public static final Immutability INSTANCE
Singleton access
-
-
Method Detail
-
instance
public static <X> MutabilityPlan<X> instance()
-
isMutable
public boolean isMutable()
Description copied from interface:MutabilityPlan
Can the internal state of instances ofT
be changed?- Specified by:
isMutable
in interfaceMutabilityPlan<Object>
- Returns:
- True if the internal state can be changed; false otherwise.
-
deepCopy
public Object deepCopy(Object value)
Description copied from interface:MutabilityPlan
Return a deep copy of the value.- Specified by:
deepCopy
in interfaceMutabilityPlan<Object>
- Parameters:
value
- The value to deep copy- Returns:
- The deep copy.
-
disassemble
public Serializable disassemble(Object value, SharedSessionContract session)
Description copied from interface:MutabilityPlan
Return a disassembled representation of the value.Called before storing a value in the second-level cache.
Complementary to
MutabilityPlan.assemble(java.io.Serializable, org.hibernate.SharedSessionContract)
.- Specified by:
disassemble
in interfaceMutabilityPlan<Object>
- See Also:
MutabilityPlan.assemble(java.io.Serializable, org.hibernate.SharedSessionContract)
-
assemble
public Object assemble(Serializable cached, SharedSessionContract session)
Description copied from interface:MutabilityPlan
Assemble a previously disassembled value.Called after reading a value from the second level cache.
Complementary to
MutabilityPlan.disassemble(T, org.hibernate.SharedSessionContract)
.- Specified by:
assemble
in interfaceMutabilityPlan<Object>
- See Also:
MutabilityPlan.disassemble(T, org.hibernate.SharedSessionContract)
-
-