Package org.kingdoms.utils.conditions
Class ConditionProcessor
java.lang.Object
org.kingdoms.utils.conditions.ConditionProcessor
- All Implemented Interfaces:
Function<String,,Object> org.kingdoms.utils.compilers.translators.ConditionalVariableTranslator,org.kingdoms.utils.compilers.translators.VariableTranslator<Object>
public final class ConditionProcessor
extends Object
implements org.kingdoms.utils.compilers.translators.ConditionalVariableTranslator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.kingdoms.utils.conditions.ConditionChain<Messenger> mapConditions(ConfigSection section) static org.kingdoms.utils.conditions.ConditionChain<Messenger> mapConditions(ConfigSection section, boolean asPath) Processes a list of conditions in form of YAML configs with keys as the condition and values as the message being sent.static booleanprocess(org.kingdoms.utils.compilers.expressions.ConditionalExpression condition, PlaceholderProvider placeholderContextProvider)
-
Constructor Details
-
ConditionProcessor
-
-
Method Details
-
process
public static boolean process(org.kingdoms.utils.compilers.expressions.ConditionalExpression condition, PlaceholderProvider placeholderContextProvider) -
mapConditions
public static org.kingdoms.utils.conditions.ConditionChain<Messenger> mapConditions(ConfigSection section) -
mapConditions
public static org.kingdoms.utils.conditions.ConditionChain<Messenger> mapConditions(ConfigSection section, boolean asPath) Processes a list of conditions in form of YAML configs with keys as the condition and values as the message being sent.E.g. conditions: 'money < 0': "You don't have enough money" 'other condition': "another message" ...
- Parameters:
asPath- whether to parse the messages as absolute language paths or compile it as a message. This option is pretty much should never be true because newer versions support special language path variables.
-
apply
-