Package ch.njol.skript.util
Class LiteralUtils
java.lang.Object
ch.njol.skript.util.LiteralUtils
A class that contains methods based around
making it easier to deal with
UnparsedLiteral
objects.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canInitSafely
(Expression<?>... expressions) Checks if the passed Expressions are non-null and do not containUnparsedLiteral
objects.static <T> Expression
<T> defendExpression
(Expression<?> expr) Checks anExpression
forUnparsedLiteral
objects and converts them if found.static boolean
hasUnparsedLiteral
(Expression<?> expr) Checks if an Expression containsUnparsedLiteral
objects.
-
Constructor Details
-
LiteralUtils
public LiteralUtils()
-
-
Method Details
-
defendExpression
Checks anExpression
forUnparsedLiteral
objects and converts them if found.- Type Parameters:
T
-expr
's type- Parameters:
expr
- The expression to check forUnparsedLiteral
objects- Returns:
expr
withoutUnparsedLiteral
objects
-
hasUnparsedLiteral
Checks if an Expression containsUnparsedLiteral
objects.- Parameters:
expr
- The Expression to check forUnparsedLiteral
objects- Returns:
- Whether or not
expr
containsUnparsedLiteral
objects
-
canInitSafely
Checks if the passed Expressions are non-null and do not containUnparsedLiteral
objects.- Parameters:
expressions
- The expressions to check forUnparsedLiteral
objects- Returns:
- Whether or not the passed expressions contain
UnparsedLiteral
objects
-