/** {@inheritDoc} */ @Override public <T> T cloneValue(T val) throws GridException { return X.cloneObject(val, true, honorCloneable); } }
/** {@inheritDoc} */ @Override public <T> T cloneValue(T val) throws GridException { return X.cloneObject(val, false, true); } }
/** {@inheritDoc} */ @SuppressWarnings( {"unchecked"}) @Override public GridCacheAtomicStampedValue<T, S> clone() throws CloneNotSupportedException { GridCacheAtomicStampedValue<T, S> obj = (GridCacheAtomicStampedValue<T, S>)super.clone(); T locVal = X.cloneObject(val, false, true); S locStamp = X.cloneObject(stamp, false, true); obj.set(locVal, locStamp); return obj; }
/** {@inheritDoc} */ @SuppressWarnings( {"unchecked"}) @Override public GridCacheAtomicReferenceValue<T> clone() throws CloneNotSupportedException { GridCacheAtomicReferenceValue<T> obj = (GridCacheAtomicReferenceValue<T>)super.clone(); T locVal = X.cloneObject(val, false, true); obj.set(locVal); return obj; }
/** * Clone cached object. * * @param obj Object to clone * @return Clone of the given object. * @throws GridException If failed to clone object. */ @SuppressWarnings({"unchecked"}) @Nullable public <T> T cloneValue(@Nullable T obj) throws GridException { if (obj == null) return obj; GridCacheCloner c = cacheCfg.getCloner(); if (c != null) return c.cloneValue(obj); return X.cloneObject(obj, false, true); }
Map<Object, Object> appendMap = (Map<Object, Object>)appendVal; Map<Object, Object> map = X.cloneObject(origMap, false, true); Collection<Object> appendCol = (Collection<Object>)appendVal; Collection<Object> col = X.cloneObject(origCol, false, true);