/** * Construct a new instance. * * @param updater the field updater * @param emptyArray an empty array of the target type * @param <T> the type which contains the target field * @param <V> the array value type * @return the new instance */ public static <T, V> AtomicArray<T, V> create(AtomicReferenceFieldUpdater<T, V[]> updater, V[] emptyArray) { Assert.checkNotNullParam("updater", updater); Assert.checkNotNullParam("emptyArray", emptyArray); if (emptyArray.length > 0) { throw Messages.msg.arrayNotEmpty(); } return new AtomicArray<>(updater, emptyArray); }
/** * Construct a new instance. * * @param updater the field updater * @param emptyArray an empty array of the target type * @param <T> the type which contains the target field * @param <V> the array value type * @return the new instance */ public static <T, V> AtomicArray<T, V> create(AtomicReferenceFieldUpdater<T, V[]> updater, V[] emptyArray) { Assert.checkNotNullParam("updater", updater); Assert.checkNotNullParam("emptyArray", emptyArray); if (emptyArray.length > 0) { throw Messages.msg.arrayNotEmpty(); } return new AtomicArray<>(updater, emptyArray); }
/** * Construct a new instance. * * @param updater the field updater * @param emptyArray an empty array of the target type * @param <T> the type which contains the target field * @param <V> the array value type * @return the new instance */ public static <T, V> AtomicArray<T, V> create(AtomicReferenceFieldUpdater<T, V[]> updater, V[] emptyArray) { Assert.checkNotNullParam("updater", updater); Assert.checkNotNullParam("emptyArray", emptyArray); if (emptyArray.length > 0) { throw Messages.msg.arrayNotEmpty(); } return new AtomicArray<>(updater, emptyArray); }