/** * Builds a new {@link PropertyRelation.When When}. * @return An immutable instance of When * @throws java.lang.IllegalStateException if any required attributes are missing */ public PropertyRelation.When build() { return ImmutableWhen.validate(new ImmutableWhen(id, value)); } }
/** * Copy the current immutable object by setting a value for the {@link PropertyRelation.When#getValue() value} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for value (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableWhen withValue(String value) { if (Objects.equals(this.value, value)) return this; return validate(new ImmutableWhen(this.id, value)); }
/** * Copy the current immutable object by setting a value for the {@link PropertyRelation.When#getId() id} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for id (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableWhen withId(String value) { if (Objects.equals(this.id, value)) return this; return validate(new ImmutableWhen(value, this.value)); }
/** * Construct a new immutable {@code When} instance. * @param id The value for the {@code id} attribute * @param value The value for the {@code value} attribute * @return An immutable When instance */ public static PropertyRelation.When of(String id, String value) { return validate(new ImmutableWhen(id, value)); }