Interface PropertyHandler.ContainsHandler<Container,Element>
- Type Parameters:
Container- The type of object that can contain elements.Element- The type of object that can be contained.
- All Superinterfaces:
PropertyHandler<Container>
- Enclosing interface:
PropertyHandler<Type>
@Experimental
public static interface PropertyHandler.ContainsHandler<Container,Element>
extends PropertyHandler<Container>
A handler that can check if a container contains a specific element.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.skriptlang.skript.lang.properties.PropertyHandler
PropertyHandler.ConditionPropertyHandler<Type>, PropertyHandler.ContainsHandler<Container,Element>, PropertyHandler.ExpressionPropertyHandler<Type, ReturnType>, PropertyHandler.TypedValuePropertyHandler<Type, ValueType> -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanContain(Class<?> type) Checks if this handler can contain the given type of element.booleanChecks if the given container contains the given element.The types of elements that can be contained.Methods inherited from interface org.skriptlang.skript.lang.properties.PropertyHandler
init, newInstance
-
Method Details
-
contains
Checks if the given container contains the given element.- Parameters:
container- The container to check.element- The element to check for.- Returns:
trueif the container contains the element,falseotherwise.
-
elementTypes
The types of elements that can be contained. This is used for type checking and auto-completion. Implementations that overridecanContain(Class)may not return accurate results for this method. Callers should prefercanContain(Class)when possible.- Returns:
- The types of elements that can be contained.
-
canContain
Checks if this handler can contain the given type of element. The default implementation checks if the given type is assignable to any of the types returned byelementTypes().- Parameters:
type- The type to check.- Returns:
trueif this handler can contain the given type,falseotherwise.
-