/** * Builds a new {@link AcquisitionMethod AcquisitionMethod}. * @return An immutable instance of AcquisitionMethod * @throws java.lang.IllegalStateException if any required attributes are missing */ public AcquisitionMethod build() { return ImmutableAcquisitionMethod.validate(new ImmutableAcquisitionMethod(description, icon, label, type)); } }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionMethod#getDescription() description} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for description (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionMethod withDescription(String value) { if (Objects.equals(this.description, value)) return this; return validate(new ImmutableAcquisitionMethod(value, this.icon, this.label, this.type)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionMethod#getIcon() icon} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for icon (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionMethod withIcon(String value) { if (Objects.equals(this.icon, value)) return this; return validate(new ImmutableAcquisitionMethod(this.description, value, this.label, this.type)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionMethod#getLabel() label} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for label (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionMethod withLabel(String value) { if (Objects.equals(this.label, value)) return this; return validate(new ImmutableAcquisitionMethod(this.description, this.icon, value, this.type)); }
/** * Copy the current immutable object by setting a value for the {@link AcquisitionMethod#getType() type} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for type (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableAcquisitionMethod withType(Type value) { if (this.type == value) return this; return validate(new ImmutableAcquisitionMethod(this.description, this.icon, this.label, value)); }
/** * Construct a new immutable {@code AcquisitionMethod} instance. * @param description The value for the {@code description} attribute * @param icon The value for the {@code icon} attribute * @param label The value for the {@code label} attribute * @param type The value for the {@code type} attribute * @return An immutable AcquisitionMethod instance */ public static AcquisitionMethod of(String description, String icon, String label, Type type) { return validate(new ImmutableAcquisitionMethod(description, icon, label, type)); }