Interface Value

    • Field Detail

      • ABSENT

        static final Value ABSENT
        The sentinel for "could not be determined statically".
    • Method Detail

      • kind

        ValueKind kind()
        Returns:
        the discriminator identifying which variant this is
      • of

        static Value of​(long v)
        Wraps a whole number.
        Parameters:
        v - the number to wrap
        Returns:
        an INT-kinded value
      • of

        static Value of​(double v)
        Wraps a floating point number.
        Parameters:
        v - the number to wrap
        Returns:
        a REAL-kinded value
      • of

        static Value of​(boolean v)
        Wraps a flag, reusing the two shared instances.
        Parameters:
        v - the flag to wrap
        Returns:
        a BOOL-kinded value
      • of

        static Value of​(String v)
        Wraps a string, mapping null onto the null value rather than failing.
        Parameters:
        v - the string to wrap, may be null
        Returns:
        a STRING-kinded value, or the NULL-kinded value when v is null
      • ofType

        static Value ofType​(String internalNameOrDescriptor)
        Wraps a type reference.
        Parameters:
        internalNameOrDescriptor - an internal name such as java/lang/String, or a descriptor such as I
        Returns:
        a TYPE-kinded value
      • ofRegex

        static Value ofRegex​(Pattern pattern)
        Wraps a compiled pattern for use as the right-hand side of a match.
        Parameters:
        pattern - the pattern to wrap
        Returns:
        a REGEX-kinded value
      • ofSet

        static Value ofSet​(List<Value> members)
        Wraps a member list for use as the right-hand side of a membership test.
        Parameters:
        members - the members, copied defensively
        Returns:
        a SET-kinded value
      • ofNull

        static Value ofNull()
        Returns:
        the shared NULL-kinded value