Interface TypedValue

All Known Subinterfaces:
File
All Known Implementing Classes:
Files.AbstractFile, Files.DataFile, Files.Directory, Files.UnknownChildFile, Files.UnknownFile

public interface TypedValue
A value that knows its own type.
  • Method Summary

    Modifier and Type
    Method
    Description
    default TypedValue
    discoverField(TypeSystem typeSystem, String fieldName)
    Tries to expand the type to include the given field name.
    default <V> V
    fieldValueAs(int fieldIndex, Class<V> clazz)
    Returns the value of a field, identified by ordinal, cast as a particular type.
    default <V> V
    fieldValueAs(String fieldName, Class<V> clazz)
    Returns the value of a field, identified by name, cast as a particular type.
    Key from which the type of this value can be constructed.
    <V> V
    valueAs(Class<V> clazz)
    Returns the value cast as a particular type.
  • Method Details

    • valueAs

      <V> V valueAs(Class<V> clazz)
      Returns the value cast as a particular type.
    • fieldValueAs

      default <V> V fieldValueAs(String fieldName, Class<V> clazz)
      Returns the value of a field, identified by name, cast as a particular type.
    • fieldValueAs

      default <V> V fieldValueAs(int fieldIndex, Class<V> clazz)
      Returns the value of a field, identified by ordinal, cast as a particular type.
    • typeKey

      Type.Key typeKey()
      Key from which the type of this value can be constructed.
    • discoverField

      default TypedValue discoverField(TypeSystem typeSystem, String fieldName)
      Tries to expand the type to include the given field name.

      Returns this value or an expanded value.