org.hibernate.type.descriptor.java.MutabilityPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
JPMS Module-Info's for a few of the Jakarta Libraries just until they add them in themselves
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.type.descriptor.java;
import java.io.Serializable;
/**
* Describes the mutability aspects of a Java type. The term mutability refers to the fact that generally speaking
* the aspects described by this contract are defined by whether the Java type's internal state is mutable or not.
*
* @author Steve Ebersole
*/
public interface MutabilityPlan extends Serializable {
/**
* Can the internal state of instances of T be changed?
*
* @return True if the internal state can be changed; false otherwise.
*/
public boolean isMutable();
/**
* Return a deep copy of the value.
*
* @param value The value to deep copy
*
* @return The deep copy.
*/
public T deepCopy(T value);
/**
* Return a "disassembled" representation of the value. This is used to push values onto the
* second level cache. Compliment to {@link #assemble}
*
* @param value The value to disassemble
*
* @return The disassembled value.
*
* @see #assemble
*/
public Serializable disassemble(T value);
/**
* Assemble a previously {@linkplain #disassemble disassembled} value. This is used when pulling values from the
* second level cache. Compliment to {@link #disassemble}
*
* @param cached The disassembled state
*
* @return The re-assembled value.
*
* @see #disassemble
*/
public T assemble(Serializable cached);
}