Class OperatingSystemRule
- java.lang.Object
-
- org.spongepowered.gradle.vanilla.internal.model.rule.OperatingSystemRule
-
- All Implemented Interfaces:
Rule<OperatingSystemRule.OSInfo>
public final class OperatingSystemRule extends java.lang.Object implements Rule<OperatingSystemRule.OSInfo>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOperatingSystemRule.OSInfo
-
Field Summary
Fields Modifier and Type Field Description static OperatingSystemRuleINSTANCE
-
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 java.lang.StringnormalizeOsName(java.lang.String name)static voidsetOsArchitecture(RuleContext ctx, java.lang.String arch)static voidsetOsName(RuleContext ctx, java.lang.String name)static voidsetOsVersion(RuleContext ctx, java.lang.String version)booleantest(RuleContext context, OperatingSystemRule.OSInfo value)Test if the declared value matches the current environment.com.google.gson.reflect.TypeToken<OperatingSystemRule.OSInfo>type()Data type of the rule.
-
-
-
Field Detail
-
INSTANCE
public static final OperatingSystemRule INSTANCE
-
-
Method Detail
-
setOsName
public static void setOsName(RuleContext ctx, java.lang.String name)
-
setOsVersion
public static void setOsVersion(RuleContext ctx, java.lang.String version)
-
setOsArchitecture
public static void setOsArchitecture(RuleContext ctx, java.lang.String arch)
-
id
public java.lang.String id()
Description copied from interface:RuleThe id for declaring the rule value- Specified by:
idin interfaceRule<OperatingSystemRule.OSInfo>- Returns:
- the rule ID
-
type
public com.google.gson.reflect.TypeToken<OperatingSystemRule.OSInfo> type()
Description copied from interface:RuleData type of the rule.This type will be used to deserialize rule values from a launcher metadata file.
- Specified by:
typein interfaceRule<OperatingSystemRule.OSInfo>- Returns:
- the rule data type
-
test
public boolean test(RuleContext context, OperatingSystemRule.OSInfo value)
Description copied from interface:RuleTest if the declared value matches the current environment.- Specified by:
testin interfaceRule<OperatingSystemRule.OSInfo>- Parameters:
context- the context representing the current environmentvalue- the rule value- Returns:
- whether there is a match
-
normalizeOsName
public static java.lang.String normalizeOsName(java.lang.String name)
-
-