Class FeatureRule
- java.lang.Object
-
- org.spongepowered.gradle.vanilla.internal.model.rule.FeatureRule
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFeatureRule.FeaturesKnown feature flags.
-
Field Summary
Fields Modifier and Type Field Description static FeatureRuleINSTANCE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Stringid()The id for declaring the rule valuestatic voidsetFeature(RuleContext context, java.lang.String feature, boolean value)Set a feature.booleantest(RuleContext context, java.util.Map<java.lang.String,java.lang.Boolean> value)Test if the declared value matches the current environment.com.google.gson.reflect.TypeToken<java.util.Map<java.lang.String,java.lang.Boolean>>type()Data type of the rule.
-
-
-
Field Detail
-
INSTANCE
public static final FeatureRule INSTANCE
-
-
Method Detail
-
setFeature
public static void setFeature(RuleContext context, java.lang.String feature, boolean value)
Set a feature.- Parameters:
context- the rule context that will eventually be testedfeature- a feature flagvalue- the value for the feature- See Also:
for a selection of known features
-
id
public java.lang.String id()
Description copied from interface:RuleThe id for declaring the rule value
-
type
public com.google.gson.reflect.TypeToken<java.util.Map<java.lang.String,java.lang.Boolean>> type()
Description copied from interface:RuleData type of the rule.This type will be used to deserialize rule values from a launcher metadata file.
-
test
public boolean test(RuleContext context, java.util.Map<java.lang.String,java.lang.Boolean> value)
Description copied from interface:RuleTest if the declared value matches the current environment.
-
-