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 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 copy
        classLoader - 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