Package ch.njol.skript.lang.util.common
Interface AnyNamed
- All Superinterfaces:
AnyProvider
- All Known Implementing Classes:
Config
,CursorSlot
,DisplayEntitySlot
,DroppedItemSlot
,DynamicFunctionReference
,EntryNode
,EquipmentSlot
,InvalidNode
,InventorySlot
,ItemFrameSlot
,ItemType
,Node
,Script
,SectionNode
,SimpleNode
,Slot
,SlotWithIndex
,ThrowableProjectileSlot
,VoidNode
- 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 with a (text) name.
Anything implementing this (or convertible to this) can be used by the
ExprName
property expression.- See Also:
-
Method Summary
Modifier and TypeMethodDescription@UnknownNullability String
name()
default void
The behaviour for changing this thing's name, if possible.default boolean
This is called beforesetName(String)
.
-
Method Details
-
name
@UnknownNullability String name()- Returns:
- This thing's name
-
supportsNameChange
default boolean supportsNameChange()This is called beforesetName(String)
. If the result is false, setting the name will never be attempted.- Returns:
- Whether this supports being set
-
setName
The behaviour for changing this thing's name, if possible. If not possible, thensupportsNameChange()
should return false and this may throw an error.- Parameters:
name
- The name to change- Throws:
UnsupportedOperationException
- If this is impossible
-