X - The type of the user typepublic class ImmutableBasicUserType<X> extends Object implements BasicUserType<X>
| Modifier and Type | Field and Description |
|---|---|
static BasicUserType<?> |
INSTANCE |
DIRTY_MARKER| Constructor and Description |
|---|
ImmutableBasicUserType() |
| Modifier and Type | Method and Description |
|---|---|
X |
deepClone(X object)
Clones the given object if the type is mutable to be able to detect mutations.
|
String[] |
getDirtyProperties(X entity)
Returns the nested properties of the object that are known to be dirty.
|
int |
hashCode(X object)
Returns the hash code of the object for lookups in hash based collections.
|
boolean |
isDeepEqual(X initial,
X current)
Returns
true if the given objects are equal regarding their values. |
boolean |
isEqual(X initial,
X current)
Returns
true if the given objects are equal regarding their identity. |
boolean |
isMutable()
Returns
true if the type is mutable, false otherwise. |
boolean |
shouldPersist(X entity)
Returns
true if the given entity object should be persisted. |
boolean |
supportsDeepCloning()
Returns
true if the type supports creating deep clones, false otherwise. |
boolean |
supportsDeepEqualChecking()
Returns
true if the type supports checking deep equality, false otherwise. |
boolean |
supportsDirtyChecking()
Returns
true if the type supports dirty checking, false otherwise. |
boolean |
supportsDirtyTracking()
Returns
true if the type supports dirty tracking, false otherwise. |
public static final BasicUserType<?> INSTANCE
public boolean isMutable()
BasicUserTypetrue if the type is mutable, false otherwise.isMutable in interface BasicUserType<X>public boolean supportsDirtyChecking()
BasicUserTypetrue if the type supports dirty checking, false otherwise.
This is only relevant when the type is also mutable.supportsDirtyChecking in interface BasicUserType<X>public boolean supportsDirtyTracking()
BasicUserTypetrue if the type supports dirty tracking, false otherwise.
Support for dirty tracking implies that the type implements the BasicDirtyTracker interface.
This is only relevant when the type is also mutable. Note that if this method returns true, the BasicUserType.supportsDirtyChecking() method should also return true.supportsDirtyTracking in interface BasicUserType<X>public boolean supportsDeepEqualChecking()
BasicUserTypetrue if the type supports checking deep equality, false otherwise.
Deep equality checking, in contrast to normal equality checking, compares objects by their actual values rather than maybe just their identity.
For value types, deep equality checking is the same as normal equality checking.supportsDeepEqualChecking in interface BasicUserType<X>public boolean supportsDeepCloning()
BasicUserTypetrue if the type supports creating deep clones, false otherwise.
Deep clones are only necessary for mutable types that don't support dirty checking. Immutable types can simply return true.supportsDeepCloning in interface BasicUserType<X>public boolean isEqual(X initial, X current)
BasicUserTypetrue if the given objects are equal regarding their identity.
For value types, this is the same as deep equality checking.isEqual in interface BasicUserType<X>initial - The first objectcurrent - The second objectpublic boolean isDeepEqual(X initial, X current)
BasicUserTypetrue if the given objects are equal regarding their values.
If deep equality is not supported, returns false.isDeepEqual in interface BasicUserType<X>initial - The first objectcurrent - The second objectpublic int hashCode(X object)
BasicUserTypehashCode in interface BasicUserType<X>object - The objectpublic boolean shouldPersist(X entity)
BasicUserTypetrue if the given entity object should be persisted.
This is invoked for user types where the type T is an entity type.
If the type is not an entity type, returns false.shouldPersist in interface BasicUserType<X>entity - The entity for which to determine whether it should be persistedpublic String[] getDirtyProperties(X entity)
BasicUserTypenull is returned.
If the properties that are dirty aren't known or the type doesn't have nested properties,
an empty array or BasicUserType.DIRTY_MARKER is returned.getDirtyProperties in interface BasicUserType<X>entity - The object for which to determine the dirty propertiespublic X deepClone(X object)
BasicUserTypefalse or dirty checking is properly supported.deepClone in interface BasicUserType<X>object - The object to cloneCopyright © 2014–2018 Blazebit. All rights reserved.