Package ch.njol.skript.lang
Interface Literal<T>
- All Superinterfaces:
Debuggable
,Expression<T>
,SyntaxElement
- All Known Implementing Classes:
ConvertedLiteral
,LiteralList
,LiteralString
,SimpleLiteral
,UnparsedLiteral
A literal, e.g. a number, string or item. Literals are constants which do not depend on the event and can thus e.g. be used in events.
-
Method Summary
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString, toString
Methods inherited from interface ch.njol.skript.lang.Expression
acceptChange, beforeChange, canBeSingle, canReturn, change, changeInPlace, changeInPlace, check, check, getAcceptedChangeModes, getAll, getAnd, getArray, getOptionalSingle, getReturnType, getSingle, getSource, getTime, isDefault, isLoopOf, isSingle, iterator, possibleReturnTypes, setTime, simplify, stream
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, init
-
Method Details
-
getArray
T[] getArray() -
getSingle
T getSingle() -
getConvertedExpression
Description copied from interface:Expression
Tries to convert this expression to the given type. This method can print an error prior to returning null to specify the cause.Please note that expressions whose
returnType
is not Object will not be parsed at all for a certain class if there's no converter from the expression's returnType to the desired class. Thus this method should only be overridden if this expression's returnType is Object.The returned expression should delegate this method to the original expression's method to prevent excessive converted expression chains (see also
ConvertedExpression
).- Specified by:
getConvertedExpression
in interfaceExpression<T>
- Parameters:
to
- The desired return type of the returned expression- Returns:
- Expression with the desired return type or null if the expression can't be converted to the given type. Returns the expression itself if it already returns the desired type.
- See Also:
-
getAll
T[] getAll()
-