/** * Fill a builder with attribute values from the provided {@code ModelExport} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder createFrom(ModelExport instance) { Objects.requireNonNull(instance, "instance"); schemaVersion(instance.schemaVersion()); return this; }
/** * Creates an immutable copy of a {@link ModelExport} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable ModelExport instance */ public static ModelExport copyOf(ModelExport instance) { if (instance instanceof ImmutableModelExport) { return (ImmutableModelExport) instance; } return ImmutableModelExport.builder() .createFrom(instance) .build(); }
static ModelExport of(final int version) { return ImmutableModelExport.builder().schemaVersion(version).build(); }
/** * Creates a builder for {@link ModelExport ModelExport}. * @return A new ModelExport builder */ public static ImmutableModelExport.Builder builder() { return new ImmutableModelExport.Builder(); }