Interface Copier
-
- All Known Implementing Classes:
AbstractCopier
,IdentityCopier
,JavaSerializationCopier
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Copier
An object is copied when the cache is configured with storeByValue to guard against mutations of the key or value.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> @NonNull T
copy(@NonNull T object, @NonNull java.lang.ClassLoader classLoader)
Returns a deep copy of the object.static Copier
identity()
-
-
-
Method Detail
-
copy
<T> @NonNull T copy(@NonNull T object, @NonNull java.lang.ClassLoader classLoader)
Returns a deep copy of the object.- Type Parameters:
T
- the type of object being copied- Parameters:
object
- the object to copyclassLoader
- the classloader to instantiate with- Returns:
- a copy of the object
-
identity
static Copier identity()
- Returns:
- a copy strategy that performs an identity function, for use by store-by-reference
-
-