Interface SelectableValue<T>

  • All Known Implementing Classes:
    OptionalValue, StructValue

    public interface SelectableValue<T>
    SelectableValue is an interface for representing a value that supports field selection and presence tests. Few examples are structs, protobuf messages, maps and optional values.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.Optional<? extends java.lang.Object> find​(T field)
      Finds the field.
      java.lang.Object select​(T field)
      Performs field selection.
    • Method Detail

      • select

        java.lang.Object select​(T field)
        Performs field selection. The behavior depends on the concrete implementation of the value being selected. For structs and maps, this must throw an exception if the field does not exist. For optional values, this will return an optional.none().
      • find

        java.util.Optional<? extends java.lang.Object> find​(T field)
        Finds the field. This will return an Optional.empty() if the field does not exist. This can be used for presence testing.