Enum ArgumentType

    • Enum Constant Detail

      • ANY

        public static final ArgumentType ANY
        Wildcard that accepts every other classification; also the fallback for an unrecognized type keyword.
      • LITERAL

        public static final ArgumentType LITERAL
        The argument is a compile-time constant pushed at the call site.
      • DYNAMIC

        public static final ArgumentType DYNAMIC
        Anything computed at run time; as an expectation it accepts FIELD, LOCAL and CALL.
      • FIELD

        public static final ArgumentType FIELD
        The argument comes straight from a field read.
      • LOCAL

        public static final ArgumentType LOCAL
        The argument comes straight from a local variable.
      • CALL

        public static final ArgumentType CALL
        The argument is the return value of another call.
    • Method Detail

      • values

        public static ArgumentType[] 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 (ArgumentType c : ArgumentType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ArgumentType 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
      • matches

        public boolean matches​(ArgumentType actual)
        Tests whether an actual argument classification satisfies this expected one.
        Parameters:
        actual - the classification observed at the call site
        Returns:
        true if this type accepts the actual type, with ANY accepting everything and DYNAMIC accepting FIELD, LOCAL, and CALL
      • fromString

        public static ArgumentType fromString​(String s)
        Parses a case-insensitive type keyword.
        Parameters:
        s - the keyword to parse, may be null
        Returns:
        the matching type, or ANY for null or unknown input