Interface AnyContains<Type>

All Superinterfaces:
AnyProvider
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 AnyContains<Type> extends AnyProvider
A provider for anything that contains other things. Anything implementing this (or convertible to this) can be used by the CondContains conditions.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    The internal method used to verify an object and then check its container.
    boolean
    contains(@UnknownNullability Type value)
    If isSafeToCheck(Object) returns false, values will not be passed to this method and will instead return false.
    default boolean
    Objects are checked versus this before being cast for contains(Object).
  • Method Details

    • contains

      boolean contains(@UnknownNullability Type value)
      If isSafeToCheck(Object) returns false, values will not be passed to this method and will instead return false.
      The null-ness of the parameter depends on whether isSafeToCheck(Object) permits null values.
      Parameters:
      value - The value to test
      Returns:
      Whether this contains value
    • isSafeToCheck

      default boolean isSafeToCheck(Object value)
      Objects are checked versus this before being cast for contains(Object). If your contains method doesn't accept all objects (e.g. for a List.contains(Object) call) then it can exclude unwanted types (or null values) here.
      Parameters:
      value - The value to check
      Returns:
      Whether the value is safe to call contains(Object) with
    • checkSafely

      @Internal default boolean checkSafely(Object value)
      The internal method used to verify an object and then check its container.