/** * Construct a new immutable {@code ContractIntCondition} instance. * @param predicate The value for the {@code predicate} attribute * @param describer The value for the {@code describer} attribute * @return An immutable ContractIntCondition instance */ public static ContractIntCondition of(IntPredicate predicate, IntFunction<String> describer) { return new ContractIntCondition(predicate, describer); }
/** * Construct a new immutable {@code ContractIntCondition} instance. * @param predicate The value for the {@code predicate} attribute * @param describer The value for the {@code describer} attribute * @return An immutable ContractIntCondition instance */ public static ContractIntCondition of(IntPredicate predicate, IntFunction<String> describer) { return new ContractIntCondition(predicate, describer); }
/** * Copy the current immutable object by setting a value for the {@link ContractIntConditionType#describer() describer} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for describer * @return A modified copy of the {@code this} object */ public final ContractIntCondition withDescriber(IntFunction<String> value) { if (this.describer == value) return this; IntFunction<String> newValue = Objects.requireNonNull(value, "describer"); return new ContractIntCondition(this, this.predicate, newValue); }
/** * Copy the current immutable object by setting a value for the {@link ContractIntConditionType#predicate() predicate} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for predicate * @return A modified copy of the {@code this} object */ public final ContractIntCondition withPredicate(IntPredicate value) { if (this.predicate == value) return this; IntPredicate newValue = Objects.requireNonNull(value, "predicate"); return new ContractIntCondition(this, newValue, this.describer); }
/** * Copy the current immutable object by setting a value for the {@link ContractIntConditionType#describer() describer} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for describer * @return A modified copy of the {@code this} object */ public final ContractIntCondition withDescriber(IntFunction<String> value) { if (this.describer == value) return this; IntFunction<String> newValue = Objects.requireNonNull(value, "describer"); return new ContractIntCondition(this, this.predicate, newValue); }
/** * Copy the current immutable object by setting a value for the {@link ContractIntConditionType#predicate() predicate} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for predicate * @return A modified copy of the {@code this} object */ public final ContractIntCondition withPredicate(IntPredicate value) { if (this.predicate == value) return this; IntPredicate newValue = Objects.requireNonNull(value, "predicate"); return new ContractIntCondition(this, newValue, this.describer); }
/** * Builds a new {@link ContractIntCondition ContractIntCondition}. * @return An immutable instance of ContractIntCondition * @throws java.lang.IllegalStateException if any required attributes are missing */ public ContractIntCondition build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ContractIntCondition(null, predicate, describer); }
/** * Builds a new {@link ContractIntCondition ContractIntCondition}. * @return An immutable instance of ContractIntCondition * @throws java.lang.IllegalStateException if any required attributes are missing */ public ContractIntCondition build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ContractIntCondition(null, predicate, describer); }