Class NewInstanceCopier

  • All Implemented Interfaces:
    Copier

    public class NewInstanceCopier
    extends Object
    implements Copier
    Copier that doesn't actually copy an object fully, but just returns a new instance of the same type.

    The object that is to be copied has to implement a public default constructor.

    Since:
    2.0
    Author:
    Arjan Tijms
    • Constructor Detail

      • NewInstanceCopier

        public NewInstanceCopier()
    • Method Detail

      • copy

        public Object copy​(Object object)
        Description copied from interface: Copier
        Return an object that's logically a copy of the given object.
        Specified by:
        copy in interface Copier
        Parameters:
        object - the object to be copied
        Returns:
        a copy of the given object