Package ch.njol.skript.lang.util.common
Interface AnyContains<Type>
- Type Parameters:
Type- the type of objects that this container can check for containment. This represents the expected type of elements that the container is designed to hold or work with. When callingcontains(Object), the parameter should be of this type, or safely castable to it. Implementations may useisSafeToCheck(Object)to verify that an object is a suitable candidate before performing a containment check.
- 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
@Deprecated(since="2.13",
forRemoval=true)
public interface AnyContains<Type>
extends AnyProvider
Deprecated, for removal: This API element is subject to removal in a future version.
A provider for anything that contains other things.
Anything implementing this (or convertible to this) can be used by the
PropCondContains
conditions.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancheckSafely(Object value) Deprecated, for removal: This API element is subject to removal in a future version.The internal method used to verify an object and then check its container.booleanDeprecated, for removal: This API element is subject to removal in a future version.IfisSafeToCheck(Object)returns false, values will not be passed to this method and will instead return false.default booleanisSafeToCheck(Object value) Deprecated, for removal: This API element is subject to removal in a future version.Objects are checked versus this before being cast forcontains(Object).
-
Method Details
-
contains
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.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
Deprecated, for removal: This API element is subject to removal in a future version.The internal method used to verify an object and then check its container.
-
Property.CONTAINSinstead.