/** * Construct a modifiable instance of {@code SMFFormatVersionType}. * @param major The value for the {@link SMFFormatVersionType#major() major} attribute * @param minor The value for the {@link SMFFormatVersionType#minor() minor} attribute * @return A new modifiable instance */ public static SMFFormatVersionMutable create(int major, int minor) { return new SMFFormatVersionMutable() .setMajor(major) .setMinor(minor); }
/** * @return The major number for a format */ @Override public final int major() { if (!majorIsSet()) { checkRequiredAttributes(); } return major; }
/** * This instance is equal to all instances of {@code SMFFormatVersionMutable} that have equal attribute values. * An uninitialized instance is equal only to itself. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(Object another) { if (this == another) return true; if (!(another instanceof SMFFormatVersionMutable)) return false; SMFFormatVersionMutable other = (SMFFormatVersionMutable) another; if (!isInitialized() || !other.isInitialized()) { return false; } return equalTo(other); }
/** * Generates a string representation of this {@code SMFFormatVersionType}. * If uninitialized, some attribute values may appear as question marks. * @return A string representation */ @Override public String toString() { return "SMFFormatVersionMutable{" + "major=" + (majorIsSet() ? major() : "?") + ", minor=" + (minorIsSet() ? minor() : "?") + "}"; } }
/** * Fill this modifiable instance with attribute values from the provided {@link SMFFormatVersionType} instance. * Regular attribute values will be overridden, i.e. replaced with ones of an instance. * Any of the instance's absent optional values will not be copied (will not override current values). * @param instance The instance from which to copy values * @return {@code this} for use in a chained invocation */ public SMFFormatVersionMutable from(SMFFormatVersionType instance) { Objects.requireNonNull(instance, "instance"); setMajor(instance.major()); setMinor(instance.minor()); return this; }
private String formatRequiredAttributesMessage() { List<String> attributes = new ArrayList<String>(); if (!majorIsSet()) attributes.add("major"); if (!minorIsSet()) attributes.add("minor"); return "SMFFormatVersion in not initialized, some of the required attributes are not set " + attributes; }
/** * @return The minor number for a format */ @Override public final int minor() { if (!minorIsSet()) { checkRequiredAttributes(); } return minor; }
private void checkRequiredAttributes() { if (!isInitialized()) { throw new IllegalStateException(formatRequiredAttributesMessage()); } }
/** * Construct a modifiable instance of {@code SMFFormatVersionType}. * @return A new modifiable instance */ public static SMFFormatVersionMutable create() { return new SMFFormatVersionMutable(); }
/** * Converts to {@link SMFFormatVersion SMFFormatVersion}. * @return An immutable instance of SMFFormatVersion */ public final SMFFormatVersion toImmutable() { checkRequiredAttributes(); return SMFFormatVersion.copyOf(this); }
/** * Generates a string representation of this {@code SMFFormatVersionType}. * If uninitialized, some attribute values may appear as question marks. * @return A string representation */ @Override public String toString() { return "SMFFormatVersionMutable{" + "major=" + (majorIsSet() ? major() : "?") + ", minor=" + (minorIsSet() ? minor() : "?") + "}"; } }
/** * Fill this modifiable instance with attribute values from the provided {@link SMFFormatVersionType} instance. * Regular attribute values will be overridden, i.e. replaced with ones of an instance. * Any of the instance's absent optional values will not be copied (will not override current values). * @param instance The instance from which to copy values * @return {@code this} for use in a chained invocation */ public SMFFormatVersionMutable from(SMFFormatVersionType instance) { Objects.requireNonNull(instance, "instance"); setMajor(instance.major()); setMinor(instance.minor()); return this; }
private String formatRequiredAttributesMessage() { List<String> attributes = new ArrayList<String>(); if (!majorIsSet()) attributes.add("major"); if (!minorIsSet()) attributes.add("minor"); return "SMFFormatVersion in not initialized, some of the required attributes are not set " + attributes; }
/** * @return The minor number for a format */ @Override public final int minor() { if (!minorIsSet()) { checkRequiredAttributes(); } return minor; }
private void checkRequiredAttributes() { if (!isInitialized()) { throw new IllegalStateException(formatRequiredAttributesMessage()); } }
/** * Construct a modifiable instance of {@code SMFFormatVersionType}. * @return A new modifiable instance */ public static SMFFormatVersionMutable create() { return new SMFFormatVersionMutable(); }
/** * Converts to {@link SMFFormatVersion SMFFormatVersion}. * @return An immutable instance of SMFFormatVersion */ public final SMFFormatVersion toImmutable() { checkRequiredAttributes(); return SMFFormatVersion.copyOf(this); }
/** * Construct a modifiable instance of {@code SMFFormatVersionType}. * @param major The value for the {@link SMFFormatVersionType#major() major} attribute * @param minor The value for the {@link SMFFormatVersionType#minor() minor} attribute * @return A new modifiable instance */ public static SMFFormatVersionMutable create(int major, int minor) { return new SMFFormatVersionMutable() .setMajor(major) .setMinor(minor); }
/** * @return The major number for a format */ @Override public final int major() { if (!majorIsSet()) { checkRequiredAttributes(); } return major; }
/** * This instance is equal to all instances of {@code SMFFormatVersionMutable} that have equal attribute values. * An uninitialized instance is equal only to itself. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(Object another) { if (this == another) return true; if (!(another instanceof SMFFormatVersionMutable)) return false; SMFFormatVersionMutable other = (SMFFormatVersionMutable) another; if (!isInitialized() || !other.isInitialized()) { return false; } return equalTo(other); }