Interface Rule<T>

  • Type Parameters:
    T - value type
    All Known Implementing Classes:
    FeatureRule, OperatingSystemRule

    public interface Rule<T>
    A rule that can filter elements of a collection.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String id()
      The id for declaring the rule value
      boolean test​(RuleContext context, T value)
      Test if the declared value matches the current environment.
      com.google.gson.reflect.TypeToken<T> type()
      Data type of the rule.
    • Method Detail

      • id

        java.lang.String id()
        The id for declaring the rule value
        Returns:
        the rule ID
      • type

        com.google.gson.reflect.TypeToken<T> type()
        Data type of the rule.

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

        Returns:
        the rule data type
      • test

        boolean test​(RuleContext context,
                     T value)
        Test if the declared value matches the current environment.
        Parameters:
        context - the context representing the current environment
        value - the rule value
        Returns:
        whether there is a match