/** * 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); }
/** * This instance is equal to all instances of {@code ContractIntCondition} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(Object another) { if (this == another) return true; return another instanceof ContractIntCondition && equalTo((ContractIntCondition) another); }
/** * Construct an {@code int} specialized predicate from the given predicate * function and describer. * * @param condition The predicate function * @param describer The describer * * @return A predicate */ public static ContractIntCondition conditionI( final IntPredicate condition, final IntFunction<String> describer) { return ContractIntCondition.of(condition, describer); }
/** * Creates an immutable copy of a {@link ContractIntConditionType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable ContractIntCondition instance */ public static ContractIntCondition copyOf(ContractIntConditionType instance) { if (instance instanceof ContractIntCondition) { return (ContractIntCondition) instance; } return ContractIntCondition.builder() .from(instance) .build(); }
/** * Creates an immutable copy of a {@link ContractIntConditionType} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable ContractIntCondition instance */ public static ContractIntCondition copyOf(ContractIntConditionType instance) { if (instance instanceof ContractIntCondition) { return (ContractIntCondition) instance; } return ContractIntCondition.builder() .from(instance) .build(); }
/** * 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); }
/** * This instance is equal to all instances of {@code ContractIntCondition} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(Object another) { if (this == another) return true; return another instanceof ContractIntCondition && equalTo((ContractIntCondition) another); }
/** * Construct an {@code int} specialized predicate from the given predicate * function and describer. * * @param condition The predicate function * @param describer The describer * * @return A predicate */ public static ContractIntCondition conditionI( final IntPredicate condition, final IntFunction<String> describer) { return ContractIntCondition.of(condition, describer); }
/** * 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#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#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); }
/** * 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); }