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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanInitSafely(Expression<?>... expressions) Checks if the passed Expressions are non-null and do not containUnparsedLiteralobjects.static <T> Expression<T> defendExpression(Expression<?> expr) Checks anExpressionforUnparsedLiteralobjects and converts them if found.static booleanhasUnparsedLiteral(Expression<?> expr) Checks if an Expression containsUnparsedLiteralobjects.
-
Constructor Details
-
LiteralUtils
public LiteralUtils()
-
-
Method Details
-
defendExpression
Checks anExpressionforUnparsedLiteralobjects and converts them if found.- Type Parameters:
T-expr's type- Parameters:
expr- The expression to check forUnparsedLiteralobjects- Returns:
exprwithoutUnparsedLiteralobjects
-
hasUnparsedLiteral
Checks if an Expression containsUnparsedLiteralobjects.- Parameters:
expr- The Expression to check forUnparsedLiteralobjects- Returns:
- Whether or not
exprcontainsUnparsedLiteralobjects
-
canInitSafely
Checks if the passed Expressions are non-null and do not containUnparsedLiteralobjects.- Parameters:
expressions- The expressions to check forUnparsedLiteralobjects- Returns:
- Whether or not the passed expressions contain
UnparsedLiteralobjects
-