Interface BooleanBinaryOperator

All Superinterfaces:
BiFunction<Boolean,Boolean,Boolean>, BinaryOperator<@NotNull 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 BooleanBinaryOperator extends BinaryOperator<@NotNull 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 Type
    Method
    Description
    static @NotNull BooleanBinaryOperator
    Creates a binary operator which always returns false.
    static @NotNull BooleanBinaryOperator
    Creates a binary operator which always returns true.
    static @NotNull BooleanBinaryOperator
    and()
    Creates a binary operator which returns the result of logical AND operation on its operands.
    default @NotNull Boolean
    apply(@NotNull Boolean left, @NotNull Boolean right)
     
    boolean
    applyAsBoolean(boolean left, boolean right)
    Applies this operator to the given operands.
    static @NotNull BooleanBinaryOperator
    or()
    Creates a binary operator which returns the result of logical OR operation on its operands.
    static @NotNull BooleanBinaryOperator
    xor()
    Creates a binary operator which returns the result of logical OR operation on its operands.

    Methods inherited from interface java.util.function.BiFunction

    andThen
  • Method Details

    • applyAsBoolean

      boolean applyAsBoolean(boolean left, boolean right)
      Applies this operator to the given operands.
      Parameters:
      left - the first operand
      right - the second operand
      Returns:
      result of applying this operation to the operands
    • apply

      @Contract("null, _ -> fail; _, null -> fail; _ -> _") @NotNull default @NotNull Boolean apply(@NotNull @NotNull Boolean left, @NotNull @NotNull Boolean right)
      Specified by:
      apply in interface BiFunction<Boolean,Boolean,Boolean>
    • alwaysTrue

      @Contract(value="-> _", pure=true) @NotNull static @NotNull BooleanBinaryOperator alwaysTrue()
      Creates a binary operator which always returns true.
      Returns:
      binary operator which always returns true
    • alwaysFalse

      @Contract(value="-> _", pure=true) @NotNull static @NotNull BooleanBinaryOperator alwaysFalse()
      Creates a binary operator which always returns false.
      Returns:
      binary operator which always returns false
    • and

      @Contract(value="-> _", pure=true) @NotNull static @NotNull BooleanBinaryOperator and()
      Creates a binary operator which returns the result of logical AND operation on its operands.
      Returns:
      binary AND-operator
    • or

      @Contract(value="-> _", pure=true) @NotNull static @NotNull BooleanBinaryOperator or()
      Creates a binary operator which returns the result of logical OR operation on its operands.
      Returns:
      binary OR-operator
    • xor

      @Contract(value="-> _", pure=true) @NotNull static @NotNull BooleanBinaryOperator xor()
      Creates a binary operator which returns the result of logical OR operation on its operands.
      Returns:
      OR-operator