Interface ShortPredicate

All Superinterfaces:
java.util.function.IntPredicate, java.util.function.Predicate<java.lang.Short>
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 ShortPredicate
extends java.util.function.Predicate<java.lang.Short>, java.util.function.IntPredicate
A type-specific Predicate; provides methods to test a primitive type both as object and as primitive.

Except for the boolean case, this interface extends both a parameterized Predicate and a type-specific JDK predicate (e.g., IntPredicate). For types missing a type-specific JDK predicate (e.g., short or float), we extend the predicate associated with the smallest primitive type that can represent the current type (e.g., int or double, respectively).

Since:
8.5.0
See Also:
Predicate
  • Method Summary

    Modifier and Type Method Description
    default ShortPredicate and​(ShortPredicate other)
    Returns a composed type-specific predicate that represents a short-circuiting logical AND of this type-specific predicate and another.
    default ShortPredicate and​(java.util.function.IntPredicate other)
    default java.util.function.Predicate<java.lang.Short> and​(java.util.function.Predicate<? super java.lang.Short> other)
    Deprecated.
    Please use the corresponding type-specific method instead.
    default ShortPredicate negate()  
    default ShortPredicate or​(ShortPredicate other)
    Returns a composed type-specific predicate that represents a short-circuiting logical OR of this type-specific predicate and another.
    default ShortPredicate or​(java.util.function.IntPredicate other)
    default java.util.function.Predicate<java.lang.Short> or​(java.util.function.Predicate<? super java.lang.Short> other)
    Deprecated.
    Please use the corresponding type-specific method instead.
    default boolean test​(int t)
    Deprecated.
    Please use the corresponding type-specific method instead.
    boolean test​(short t)
    Evaluates this predicate on the given input.
    default boolean test​(java.lang.Short t)
    Deprecated.
    Please use the corresponding type-specific method instead.
  • Method Details

    • test

      boolean test​(short t)
      Evaluates this predicate on the given input.
      Parameters:
      t - the input.
      Returns:
      true if the input matches the predicate, otherwise false
    • test

      @Deprecated default boolean test​(int t)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      test in interface java.util.function.IntPredicate
    • test

      @Deprecated default boolean test​(java.lang.Short t)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      test in interface java.util.function.Predicate<java.lang.Short>
    • and

      default ShortPredicate and​(ShortPredicate other)
      Returns a composed type-specific predicate that represents a short-circuiting logical AND of this type-specific predicate and another.
      Parameters:
      other - a predicate that will be logically-ANDed with this predicate.
      Returns:
      a composed predicate that represents the short-circuiting logical AND of this predicate and the other predicate.
      See Also:
      Predicate.and(java.util.function.Predicate<? super T>)
      API Notes:
      Implementing classes should generally override this method and keep the default implementation of the other overloads, which will delegate to this method (after proper conversions).
    • and

      default ShortPredicate and​(java.util.function.IntPredicate other)
      Specified by:
      and in interface java.util.function.IntPredicate
      Implementation Notes:
      Composing with a JDK type-specific predicate will be slightly less efficient than using a type-specific predicate, as the argument will have to be widened at each call.
    • and

      @Deprecated default java.util.function.Predicate<java.lang.Short> and​(java.util.function.Predicate<? super java.lang.Short> other)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      and in interface java.util.function.Predicate<java.lang.Short>
    • negate

      default ShortPredicate negate()
      Specified by:
      negate in interface java.util.function.IntPredicate
      Specified by:
      negate in interface java.util.function.Predicate<java.lang.Short>
    • or

      default ShortPredicate or​(ShortPredicate other)
      Returns a composed type-specific predicate that represents a short-circuiting logical OR of this type-specific predicate and another.
      Parameters:
      other - a predicate that will be logically-ORed with this predicate.
      Returns:
      a composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate.
      See Also:
      Predicate.or(java.util.function.Predicate<? super T>)
      API Notes:
      Implementing classes should generally override this method and keep the default implementation of the other overloads, which will delegate to this method (after proper conversions).
    • or

      default ShortPredicate or​(java.util.function.IntPredicate other)
      Specified by:
      or in interface java.util.function.IntPredicate
      Implementation Notes:
      Composing with a JDK type-specific predicate will be slightly less efficient than using a type-specific predicate, as the argument will have to be widened at each call.
    • or

      @Deprecated default java.util.function.Predicate<java.lang.Short> or​(java.util.function.Predicate<? super java.lang.Short> other)
      Deprecated.
      Please use the corresponding type-specific method instead.
      Specified by:
      or in interface java.util.function.Predicate<java.lang.Short>