Package: org.apache.groovy.json.internal

## [Java] Interface Value

-     public interface Value

  Represents a lazily decoded JSON token or container managed by the index-overlay parser.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public BigDecimal` | `bigDecimalValue()` Converts this token to a BigDecimal.
    `` | `public BigInteger` | `bigIntegerValue()` Converts this token to a BigInteger.
    `` | `public boolean` | `booleanValue()` Converts this token to a boolean value.
    `` | `public byte` | `byteValue()` Converts this token to a byte value.
    `` | `public char` | `charValue()` Converts this token to a single character.
    `` | `public void` | `chop()` Copies any shared backing buffer into a dedicated slice.
    `` | `public Date` | `dateValue()` Converts this token to a Date.
    `` | `public double` | `doubleValue()` Converts this token to a double value.
    `` | `public float` | `floatValue()` Converts this token to a float value.
    `` | `public int` | `intValue()` Converts this token to an int value.
    `` | `public boolean` | `isContainer()` Indicates whether this value wraps a map or a collection.
    `` | `public long` | `longValue()` Converts this token to a long value.
    `` | `public short` | `shortValue()` Converts this token to a short value.
    `` | `public String` | `stringValue()` Returns the string form using the value's configured decoding policy.
    `` | `public String` | `stringValueEncoded()` Returns the fully decoded string form.
    `<T extends Enum>` | `public T` | `toEnum(Class<T> cls)` Converts this token to an enum constant.
    `` | `public Object` | `toValue()` Materializes this token as a regular Java value.

- - ### Method Detail

    - #### public BigDecimal bigDecimalValue()

      Converts this token to a BigDecimal.

      Returns:
        the decimal representation

    - #### public BigInteger bigIntegerValue()

      Converts this token to a BigInteger.

      Returns:
        the integer representation

    - #### public boolean booleanValue()

      Converts this token to a boolean value.

      Returns:
        the boolean representation

    - #### public byte byteValue()

      Converts this token to a byte value.

      Returns:
        the byte representation

    - #### public char charValue()

      Converts this token to a single character.

      Returns:
        the leading character representation

    - #### public void chop()

      Copies any shared backing buffer into a dedicated slice.

    - #### public Date dateValue()

      Converts this token to a Date.

      Returns:
        the date representation

    - #### public double doubleValue()

      Converts this token to a double value.

      Returns:
        the double representation

    - #### public float floatValue()

      Converts this token to a float value.

      Returns:
        the float representation

    - #### public int intValue()

      Converts this token to an int value.

      Returns:
        the int representation

    - #### public boolean isContainer()

      Indicates whether this value wraps a map or a collection.

      Returns:
        `true` for container values

    - #### public long longValue()

      Converts this token to a long value.

      Returns:
        the long representation

    - #### public short shortValue()

      Converts this token to a short value.

      Returns:
        the short representation

    - #### public String stringValue()

      Returns the string form using the value's configured decoding policy.

      Returns:
        the string representation

    - #### public String stringValueEncoded()

      Returns the fully decoded string form.

      Returns:
        the decoded string representation

    - #### <T extends Enum> public T toEnum(Class<T> cls)

      Converts this token to an enum constant.

      Parameters:
        `cls` - enum type to resolve
      Type Parameters:
        `T` - enum type
      Returns:
        the resolved enum constant

    - #### public Object toValue()

      Materializes this token as a regular Java value.

      Returns:
        the hydrated value