/** * Construct a new immutable {@code ModelExport} instance. * @param schemaVersion The value for the {@code schemaVersion} attribute * @return An immutable ModelExport instance */ public static ModelExport of(int schemaVersion) { return validate(new ImmutableModelExport(schemaVersion)); }
/** * This instance is equal to all instances of {@code ImmutableModelExport} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@Nullable Object another) { if (this == another) return true; return another instanceof ImmutableModelExport && equalTo((ImmutableModelExport) another); }
static ModelExport of(final int version) { return ImmutableModelExport.builder().schemaVersion(version).build(); }
/** * Builds a new {@link ModelExport ModelExport}. * @return An immutable instance of ModelExport * @throws java.lang.IllegalStateException if any required attributes are missing */ public ModelExport build() { return ImmutableModelExport.validate(new ImmutableModelExport(schemaVersion)); } }
/** * 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(); }
/** * Copy the current immutable object by setting a value for the {@link ModelExport#schemaVersion() schemaVersion} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for schemaVersion * @return A modified copy of the {@code this} object */ public final ImmutableModelExport withSchemaVersion(int value) { if (this.schemaVersion == value) return this; return validate(new ImmutableModelExport(value)); }