Package ch.njol.skript.lang.util.common
Interface AnyValued<Type>
- All Superinterfaces:
AnyProvider
- All Known Implementing Classes:
EntryNode
Deprecated, for removal: This API element is subject to removal in a future version.
A provider for anything with a value.
Anything implementing this (or convertible to this) can be used by the
ExprSubnodeValue
property expression.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
changeValue
(Type value) Deprecated, for removal: This API element is subject to removal in a future version.The behaviour for changing this thing's value, if possible.default void
changeValueSafely
(Object value) Deprecated, for removal: This API element is subject to removal in a future version.This method can be overridden to filter out bad values (e.g.default <Converted>
ConvertedconvertedValue
(ClassInfo<Converted> expected) Deprecated, for removal: This API element is subject to removal in a future version.default void
Deprecated, for removal: This API element is subject to removal in a future version.A default implementation of 'resetting' the value (setting it to null).default boolean
Deprecated, for removal: This API element is subject to removal in a future version.This is called beforechangeValue(Object)
.@UnknownNullability Type
value()
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
value
@UnknownNullability Type value()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- This thing's value
-
convertedValue
Deprecated, for removal: This API element is subject to removal in a future version. -
supportsValueChange
default boolean supportsValueChange()Deprecated, for removal: This API element is subject to removal in a future version.This is called beforechangeValue(Object)
. If the result is false, setting the value will never be attempted.- Returns:
- Whether this supports being set
-
changeValue
Deprecated, for removal: This API element is subject to removal in a future version.The behaviour for changing this thing's value, if possible. If not possible, thensupportsValueChange()
should return false and this may throw an error.- Parameters:
value
- The new value- Throws:
UnsupportedOperationException
- If this is impossible
-
valueType
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The type of values this accepts (or provides)
-
resetValue
Deprecated, for removal: This API element is subject to removal in a future version.A default implementation of 'resetting' the value (setting it to null). Implementations should override this if different behaviour is required.- Throws:
UnsupportedOperationException
- If changing is not supported
-
changeValueSafely
Deprecated, for removal: This API element is subject to removal in a future version.This method can be overridden to filter out bad values (e.g. null, objects of the wrong type, etc.) and make surechangeValue(Object)
is not called with a bad parameter.- Parameters:
value
- The (unchecked) new value- Throws:
UnsupportedOperationException
-
Property.TYPED_VALUE
instead.