@Immutable public final class CloneHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <DATATYPE extends ICloneable<DATATYPE>> |
getClonedList(Iterable<DATATYPE> aList)
Get a list where each contained item is also cloned.
|
static <DATATYPE> DATATYPE |
getClonedValue(DATATYPE aObject)
Get a clone (= deep copy) of the passed value.
|
static <DATATYPE extends ICloneable<DATATYPE>> |
getCloneIfNotNull(DATATYPE aObject)
Get a clone (= deep copy) of the passed value for all objects implementing
ICloneable. |
static <DATATYPE> ICommonsList<DATATYPE> |
getGenericClonedList(Iterable<DATATYPE> aList)
Get a list where each contained item is also cloned.
|
@Nullable public static <DATATYPE> DATATYPE getClonedValue(@Nullable DATATYPE aObject)
Immutable annotation.ICloneable it is invoked.Cloneable it is invoked.null is returned.DATATYPE - The source and return typeaObject - The object to be copied.null if the passed value is null or if no
cloning could be performed.@Nullable public static <DATATYPE extends ICloneable<DATATYPE>> DATATYPE getCloneIfNotNull(@Nullable DATATYPE aObject)
ICloneable.DATATYPE - The data type to be clonedaObject - The object to be copied. May be null.null if the passed value is null or a
clone of the object.@Nonnull @ReturnsMutableCopy public static <DATATYPE> ICommonsList<DATATYPE> getGenericClonedList(@Nullable Iterable<DATATYPE> aList)
DATATYPE - The list element type to be clonedaList - Source list. May be null.null but maybe empty if the
source list is empty.@Nonnull @ReturnsMutableCopy public static <DATATYPE extends ICloneable<DATATYPE>> ICommonsList<DATATYPE> getClonedList(@Nullable Iterable<DATATYPE> aList)
DATATYPE - The set element type to be clonedaList - Source list. May be null.null but maybe empty if the
source list is empty.Copyright © 2014–2020 Philip Helger. All rights reserved.