Class ClonerNoop<T>

  • All Implemented Interfaces:
    Cloner<T>

    public final class ClonerNoop<T>
    extends Object
    implements Cloner<T>
    ClonerNoop is an implementation of the Cloner interface which returns the same object (or null).
    Author:
    Philipp Meinen
    • Field Detail

      • INSTANCE

        public static final Cloner<?> INSTANCE
    • Constructor Detail

      • ClonerNoop

        public ClonerNoop()
    • Method Detail

      • clone

        public T clone​(T obj)
        Description copied from interface: Cloner
        Clones a given object.
        Specified by:
        clone in interface Cloner<T>
        Parameters:
        obj - The object to clone - may be null.
        Returns:
        the cloned object or null if the input parameter was null.
      • get

        public static <T> Cloner<T> get()
      • getIfNull

        public static <T> Cloner<T> getIfNull​(Cloner<T> cloner)