/** * Construct a new immutable {@code ContractLongCondition} instance. * @param predicate The value for the {@code predicate} attribute * @param describer The value for the {@code describer} attribute * @return An immutable ContractLongCondition instance */ public static ContractLongCondition of(LongPredicate predicate, LongFunction<String> describer) { return new ContractLongCondition(predicate, describer); }
/** * This instance is equal to all instances of {@code ContractLongCondition} 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 ContractLongCondition && equalTo((ContractLongCondition) another); }
/** * Construct a {@code long} specialized predicate from the given predicate * function and describer. * * @param condition The predicate function * @param describer The describer * * @return A predicate */ public static ContractLongCondition conditionL( final LongPredicate condition, final LongFunction<String> describer) { return ContractLongCondition.of(condition, describer); }
/** * Creates an immutable copy of a {@link ContractLongConditionType} 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 ContractLongCondition instance */ public static ContractLongCondition copyOf(ContractLongConditionType instance) { if (instance instanceof ContractLongCondition) { return (ContractLongCondition) instance; } return ContractLongCondition.builder() .from(instance) .build(); }
/** * Creates an immutable copy of a {@link ContractLongConditionType} 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 ContractLongCondition instance */ public static ContractLongCondition copyOf(ContractLongConditionType instance) { if (instance instanceof ContractLongCondition) { return (ContractLongCondition) instance; } return ContractLongCondition.builder() .from(instance) .build(); }
/** * Construct a new immutable {@code ContractLongCondition} instance. * @param predicate The value for the {@code predicate} attribute * @param describer The value for the {@code describer} attribute * @return An immutable ContractLongCondition instance */ public static ContractLongCondition of(LongPredicate predicate, LongFunction<String> describer) { return new ContractLongCondition(predicate, describer); }
/** * This instance is equal to all instances of {@code ContractLongCondition} 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 ContractLongCondition && equalTo((ContractLongCondition) another); }
/** * Construct a {@code long} specialized predicate from the given predicate * function and describer. * * @param condition The predicate function * @param describer The describer * * @return A predicate */ public static ContractLongCondition conditionL( final LongPredicate condition, final LongFunction<String> describer) { return ContractLongCondition.of(condition, describer); }
/** * Copy the current immutable object by setting a value for the {@link ContractLongConditionType#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 ContractLongCondition withPredicate(LongPredicate value) { if (this.predicate == value) return this; LongPredicate newValue = Objects.requireNonNull(value, "predicate"); return new ContractLongCondition(this, newValue, this.describer); }
/** * Copy the current immutable object by setting a value for the {@link ContractLongConditionType#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 ContractLongCondition withPredicate(LongPredicate value) { if (this.predicate == value) return this; LongPredicate newValue = Objects.requireNonNull(value, "predicate"); return new ContractLongCondition(this, newValue, this.describer); }
/** * Copy the current immutable object by setting a value for the {@link ContractLongConditionType#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 ContractLongCondition withDescriber(LongFunction<String> value) { if (this.describer == value) return this; LongFunction<String> newValue = Objects.requireNonNull(value, "describer"); return new ContractLongCondition(this, this.predicate, newValue); }
/** * Copy the current immutable object by setting a value for the {@link ContractLongConditionType#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 ContractLongCondition withDescriber(LongFunction<String> value) { if (this.describer == value) return this; LongFunction<String> newValue = Objects.requireNonNull(value, "describer"); return new ContractLongCondition(this, this.predicate, newValue); }
/** * Builds a new {@link ContractLongCondition ContractLongCondition}. * @return An immutable instance of ContractLongCondition * @throws java.lang.IllegalStateException if any required attributes are missing */ public ContractLongCondition build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ContractLongCondition(null, predicate, describer); }
/** * Builds a new {@link ContractLongCondition ContractLongCondition}. * @return An immutable instance of ContractLongCondition * @throws java.lang.IllegalStateException if any required attributes are missing */ public ContractLongCondition build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ContractLongCondition(null, predicate, describer); }