Class OperatingSystemRule

    • 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: Rule
        The id for declaring the rule value
        Specified by:
        id in interface Rule<OperatingSystemRule.OSInfo>
        Returns:
        the rule ID
      • type

        public com.google.gson.reflect.TypeToken<OperatingSystemRule.OSInfo> type()
        Description copied from interface: Rule
        Data type of the rule.

        This type will be used to deserialize rule values from a launcher metadata file.

        Specified by:
        type in interface Rule<OperatingSystemRule.OSInfo>
        Returns:
        the rule data type
      • test

        public boolean test​(RuleContext context,
                            OperatingSystemRule.OSInfo value)
        Description copied from interface: Rule
        Test if the declared value matches the current environment.
        Specified by:
        test in interface Rule<OperatingSystemRule.OSInfo>
        Parameters:
        context - the context representing the current environment
        value - the rule value
        Returns:
        whether there is a match
      • normalizeOsName

        public static java.lang.String normalizeOsName​(java.lang.String name)