Enum AccessPattern

  • All Implemented Interfaces:
    Serializable, Comparable<AccessPattern>

    public enum AccessPattern
    extends Enum<AccessPattern>
    Enumeration used to indicate required access pattern for providers: this can sometimes be used to optimize out dynamic calls. The main difference is between constant values (which can be resolved once) and dynamic ones (which must be resolved anew every time).
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALWAYS_NULL
      Value that indicates that provider never returns anything other than Java `null`.
      CONSTANT
      Value that indicates that provider will always return a constant value, regardless of when it is called; and also that it never uses `context` argument (which may then be passed as `null`)
      DYNAMIC
      Value that indicates that provider may return different values at different times (often a freshly constructed empty container), and thus must be called every time "null replacement" value is needed.
    • Enum Constant Detail

      • ALWAYS_NULL

        public static final AccessPattern ALWAYS_NULL
        Value that indicates that provider never returns anything other than Java `null`.
      • CONSTANT

        public static final AccessPattern CONSTANT
        Value that indicates that provider will always return a constant value, regardless of when it is called; and also that it never uses `context` argument (which may then be passed as `null`)
      • DYNAMIC

        public static final AccessPattern DYNAMIC
        Value that indicates that provider may return different values at different times (often a freshly constructed empty container), and thus must be called every time "null replacement" value is needed.
    • Method Detail

      • values

        public static AccessPattern[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (AccessPattern c : AccessPattern.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static AccessPattern valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null