Class MultiStrategyCopier

  • All Implemented Interfaces:
    Copier

    public class MultiStrategyCopier
    extends Object
    implements Copier
    Copier that copies an object trying a variety of strategies until one succeeds.

    The strategies that will be attempted in order are:

    1. Cloning
    2. Serialization
    3. Copy constructor
    4. New instance
    Since:
    2.0
    Author:
    Arjan Tijms
    • Constructor Detail

      • MultiStrategyCopier

        public MultiStrategyCopier()
    • 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