Interface Copyable<T>

Type Parameters:
T - The type of the object that is being copied.
All Known Implementing Classes:
Result
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 Copyable<T>
Interface for objects that can be copied. Should be used instead of Cloneable because the latter is broken.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Copyable<T>
     
  • Method Details

    • copy

      @Contract(pure=true) @NonNull @NonNull Copyable<T> copy()
      Returns:
      A deep copy of the object, i.e. a clone that has the exact same values as the original object, but is a different instance (new reference).
      Implementation Requirements:
      Must not throw any exceptions. Must not have any side effects.