Class CloneUtil

  • public class CloneUtil
    extends Object
    • Constructor Detail

      • CloneUtil

        public CloneUtil()
    • Method Detail

      • clone

        @Contract("null -> null; !null -> !null")
        public static <T> T clone​(T orig)
      • cloneCloneable

        public static <T extends Cloneable> T cloneCloneable​(T cloneable)
      • cloneCollectionMembers

        @Contract("!null -> !null; null -> null")
        public static <T> List<T> cloneCollectionMembers​(Collection<T> collection)
        List that can be freely used.
      • cloneMembersToCollection

        public static <T> void cloneMembersToCollection​(Collection<T> target,
                                                        Collection<T> source)
      • cloneCollectionMembersWithoutIds

        @Contract("!null -> !null; null -> null")
        public static <T> List<T> cloneCollectionMembersWithoutIds​(Collection<T> collection)
        List that contains its members clones. For members that are Containerable the IDs are cleared. FIXME: BEWARE - UNFINISHED - does not clear IDs if members are PCVs; does it only for Containerables - should be named maybe "copyForReuse" and use complexClone with the strategy of REUSE for all prism data See Containerable.cloneWithoutId() and its TODOs.
      • cloneIfImmutable

        @Contract("null -> null; !null -> !null")
        public static <C extends Containerable> C cloneIfImmutable​(@Nullable
                                                                   C value)