Interface BooleanUnaryOperator
- All Superinterfaces:
BooleanFunction<Boolean>,Function<Boolean,,Boolean> UnaryOperator<Boolean>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface BooleanUnaryOperator
extends BooleanFunction<Boolean>, UnaryOperator<Boolean>
Represents an operation on a single
boolean operand that produces a boolean} result.
This is the primitive type specialization of UnaryOperator for boolean.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull BooleanUnaryOperatorandThenPrimitive(@NonNull BooleanUnaryOperator after) Returns a composed operator that first applies this operator to its input and then applies theafteroperator to the result.default @NotNull Booleanapply(boolean argument) Applies this function to the given argument.booleanapplyAsBoolean(boolean operand) Applies this operator to the given operand.default @NotNull BooleanUnaryOperatorcomposePrimitive(@NonNull BooleanUnaryOperator before) Returns a composed operator that first applies thebeforeoperator to its input and then applies this operator to the result.static @NotNull BooleanUnaryOperatoridentity()Returns an unary operator that always returns its input argument.static @NotNull BooleanUnaryOperatorReturns an unary operator that always returns inverted input argument.default @NotNull BooleanUnaryOperatorinvert()Returns a composed operator that first applies this operator and and then inverts the result.Methods inherited from interface ru.progrm_jarvis.javacommons.util.function.BooleanFunction
apply
-
Method Details
-
applyAsBoolean
boolean applyAsBoolean(boolean operand) Applies this operator to the given operand.- Parameters:
operand- the operand to which to apply this operation- Returns:
- result of applying this operation to the operand
-
apply
Description copied from interface:BooleanFunctionApplies this function to the given argument.- Specified by:
applyin interfaceBooleanFunction<Boolean>- Parameters:
argument- the function argument- Returns:
- the function result
-
compose
-
composePrimitive
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull BooleanUnaryOperator composePrimitive(@NonNull @NonNull BooleanUnaryOperator before) Returns a composed operator that first applies thebeforeoperator to its input and then applies this operator to the result.- Parameters:
before- the operator to provide the value to this operator- Returns:
- a composed operator that first applies the provided operator and then this one
- Throws:
NullPointerException- ifbeforeisnull- See Also:
-
andThen
-
andThenPrimitive
@Contract(value="null -> fail; _ -> _", pure=true) @NotNull default @NotNull BooleanUnaryOperator andThenPrimitive(@NonNull @NonNull BooleanUnaryOperator after) Returns a composed operator that first applies this operator to its input and then applies theafteroperator to the result.- Parameters:
after- the operator to operate on the value provided by this operator- Returns:
- a composed operator that first applies this operator and then the provided one
- Throws:
NullPointerException- ifafterisnull- See Also:
-
invert
Returns a composed operator that first applies this operator and and then inverts the result.- Returns:
- a composed operator that first applies this operator and then inverts the result
-
identity
Returns an unary operator that always returns its input argument.- Returns:
- an unary operator that always returns its input argument
-
inversion
Returns an unary operator that always returns inverted input argument.- Returns:
- an unary operator that always returns inverted input argument
-