Package org.openhab.core.automation.util
Class RuleUtil
java.lang.Object
org.openhab.core.automation.util.RuleUtil
The
RuleUtil class contains utility methods for Rule objects.
This class cannot be instantiated, it only contains static methods.- Author:
- Ravi Nadahar - Initial contribution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertValidRuleUID(String uid) Ensures that the specified rule UID is valid.static booleanisValidRuleUID(String uid) Returnstrueif the specified UID is a valid rule UID, otherwisefalse.
-
Constructor Details
-
RuleUtil
public RuleUtil()
-
-
Method Details
-
isValidRuleUID
Returnstrueif the specified UID is a valid rule UID, otherwisefalse.A valid rule UID is any string that doesn't contain
/,\and has no leading or trailing whitespace.- Parameters:
uid- the UID of the rule to be checked.- Returns:
trueif the specified UID is a valid rule UID,falseotherwise.
-
assertValidRuleUID
Ensures that the specified rule UID is valid.If the rule UID is invalid an
IllegalArgumentExceptionis thrown, otherwise this method returns silently.A valid rule UID is any string that doesn't contain
/,\and has no leading or trailing whitespace.- Parameters:
uid- the UID of the rule to be checked.- Throws:
IllegalArgumentException- If the specified rule UID is invalid.
-