Class MutableBasicUserType<X>
java.lang.Object
com.blazebit.persistence.view.spi.type.AbstractMutableBasicUserType<X>
com.blazebit.persistence.view.spi.type.MutableBasicUserType<X>
- Type Parameters:
X- The type of the user type
- All Implemented Interfaces:
BasicUserType<X>,BasicUserTypeStringSupport<X>
The default basic user type implementation for unknown types.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Field Summary
FieldsFields inherited from interface com.blazebit.persistence.view.spi.type.BasicUserType
DIRTY_MARKER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClones the given object if the type is mutable to be able to detect mutations.fromString(CharSequence sequence) Creates an instance of the type from the given string representation.intReturns the hash code of the object for lookups in hash based collections.booleanisDeepEqual(X initial, X current) Returnstrueif the given objects are equal regarding their values.booleanReturnstrueif the given objects are equal regarding their identity.booleanReturnstrueif the type supports creating deep clones,falseotherwise.booleanReturnstrueif the type supports checking deep equality,falseotherwise.toStringExpression(String expression) Wraps the given JPQL.Next expression such that it is converted to the internal string representation that can be read byBasicUserTypeStringSupport.fromString(CharSequence).Methods inherited from class com.blazebit.persistence.view.spi.type.AbstractMutableBasicUserType
getDirtyProperties, isMutable, shouldPersist, supportsDirtyChecking, supportsDirtyTracking
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
MutableBasicUserType
public MutableBasicUserType()
-
-
Method Details
-
supportsDeepEqualChecking
public boolean supportsDeepEqualChecking()Description copied from interface:BasicUserTypeReturnstrueif the type supports checking deep equality,falseotherwise. 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.- Specified by:
supportsDeepEqualCheckingin interfaceBasicUserType<X>- Overrides:
supportsDeepEqualCheckingin classAbstractMutableBasicUserType<X>- Returns:
- true if deep equality checking is supported, false otherwise
-
supportsDeepCloning
public boolean supportsDeepCloning()Description copied from interface:BasicUserTypeReturnstrueif the type supports creating deep clones,falseotherwise. Deep clones are only necessary for mutable types that don't support dirty checking. Immutable types can simply returntrue.- Specified by:
supportsDeepCloningin interfaceBasicUserType<X>- Overrides:
supportsDeepCloningin classAbstractMutableBasicUserType<X>- Returns:
- true if deep cloning is supported, false otherwise
-
isEqual
Description copied from interface:BasicUserTypeReturnstrueif the given objects are equal regarding their identity. For value types, this is the same as deep equality checking.- Specified by:
isEqualin interfaceBasicUserType<X>- Overrides:
isEqualin classAbstractMutableBasicUserType<X>- Parameters:
initial- The first objectcurrent- The second object- Returns:
- true if the objects are equal, false otherwise
-
isDeepEqual
Description copied from interface:BasicUserTypeReturnstrueif the given objects are equal regarding their values. If deep equality is not supported, returns false.- Specified by:
isDeepEqualin interfaceBasicUserType<X>- Overrides:
isDeepEqualin classAbstractMutableBasicUserType<X>- Parameters:
initial- The first objectcurrent- The second object- Returns:
- true if the objects are equal, false otherwise
-
hashCode
Description copied from interface:BasicUserTypeReturns the hash code of the object for lookups in hash based collections.- Specified by:
hashCodein interfaceBasicUserType<X>- Overrides:
hashCodein classAbstractMutableBasicUserType<X>- Parameters:
object- The object- Returns:
- the hash code of the object
-
deepClone
Description copied from interface:BasicUserTypeClones the given object if the type is mutable to be able to detect mutations. Immutable types may return the object itself. Types that can't be cloned easily can return the object too, but should make sure, that the deep equality check always returnsfalseor dirty checking is properly supported.- Parameters:
object- The object to clone- Returns:
- The cloned object
-
fromString
Description copied from interface:BasicUserTypeStringSupportCreates an instance of the type from the given string representation.- Specified by:
fromStringin interfaceBasicUserTypeStringSupport<X>- Overrides:
fromStringin classAbstractMutableBasicUserType<X>- Parameters:
sequence- A string representation of the object- Returns:
- The object
-
toStringExpression
Description copied from interface:BasicUserTypeStringSupportWraps the given JPQL.Next expression such that it is converted to the internal string representation that can be read byBasicUserTypeStringSupport.fromString(CharSequence).- Specified by:
toStringExpressionin interfaceBasicUserTypeStringSupport<X>- Overrides:
toStringExpressionin classAbstractMutableBasicUserType<X>- Parameters:
expression- The JPQL.Next expression string- Returns:
- The object
-