Package ch.njol.skript.lang.util.common
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.
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 TypeMethodDescriptiondefault boolean
checkSafely
(Object value) The internal method used to verify an object and then check its container.boolean
IfisSafeToCheck(Object)
returns false, values will not be passed to this method and will instead return false.default boolean
isSafeToCheck
(Object value) Objects are checked versus this before being cast forcontains(Object)
.
-
Method Details
-
contains
IfisSafeToCheck(Object)
returns false, values will not be passed to this method and will instead return false.
The null-ness of the parameter depends on whetherisSafeToCheck(Object)
permits null values.- Parameters:
value
- The value to test- Returns:
- Whether this contains
value
-
isSafeToCheck
Objects are checked versus this before being cast forcontains(Object)
. If your contains method doesn't accept all objects (e.g. for aList.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
The internal method used to verify an object and then check its container.
-