/** * Copy the current immutable object by setting a value for the {@link SMFAttributeNameType#value() value} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for value * @return A modified copy of the {@code this} object */ public final SMFAttributeName withValue(String value) { if (this.value.equals(value)) return this; String newValue = Objects.requireNonNull(value, "value"); return validate(new SMFAttributeName(this, newValue)); }
/** * Construct a new immutable {@code SMFAttributeName} instance. * @param value The value for the {@code value} attribute * @return An immutable SMFAttributeName instance */ public static SMFAttributeName of(String value) { return validate(new SMFAttributeName(value)); }
/** * Construct a new immutable {@code SMFAttributeName} instance. * @param value The value for the {@code value} attribute * @return An immutable SMFAttributeName instance */ public static SMFAttributeName of(String value) { return validate(new SMFAttributeName(value)); }
/** * Copy the current immutable object by setting a value for the {@link SMFAttributeNameType#value() value} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for value * @return A modified copy of the {@code this} object */ public final SMFAttributeName withValue(String value) { if (this.value.equals(value)) return this; String newValue = Objects.requireNonNull(value, "value"); return validate(new SMFAttributeName(this, newValue)); }
/** * Builds a new {@link SMFAttributeName SMFAttributeName}. * @return An immutable instance of SMFAttributeName * @throws java.lang.IllegalStateException if any required attributes are missing */ public SMFAttributeName build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return SMFAttributeName.validate(new SMFAttributeName(null, value)); }
/** * Builds a new {@link SMFAttributeName SMFAttributeName}. * @return An immutable instance of SMFAttributeName * @throws java.lang.IllegalStateException if any required attributes are missing */ public SMFAttributeName build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return SMFAttributeName.validate(new SMFAttributeName(null, value)); }