public RevFeature build(ObjectId id) { return new RevFeatureImpl(id, new ArrayList<>(values)); }
/** * @implNote: In order to preserve the {@link ValueArray}'s immutability, a safe copy of each * element in {@code values} will be assigned if it's a mutable type. */ public @Override @NonNull RevFeature createFeature(@NonNull ObjectId id, @NonNull Object... values) { Object[] safe = new Object[values.length]; for (int i = 0; i < values.length; i++) { safe[i] = ValueArray.safeCopy(values[i]); } return new RevFeatureImpl(id, safe); }
/** * @implNote: In order to preserve the {@link ValueArray}'s immutability, a safe copy of each * element in {@code values} will be assigned if it's a mutable type. */ public @Override @NonNull RevFeature createFeature(@NonNull ObjectId id, @NonNull List<Object> values) { Object[] safe = new Object[values.size()]; for (int i = 0; i < values.size(); i++) { safe[i] = ValueArray.safeCopy(values.get(i)); } return new RevFeatureImpl(id, safe); }
public RevFeature build() { ObjectId id = HashObject.hashFeature(values); return new RevFeatureImpl(id, new ArrayList<>(values)); }