Class ObjectValue

java.lang.Object
build.buf.protovalidate.internal.evaluator.ObjectValue
All Implemented Interfaces:
Value

public final class ObjectValue extends Object implements Value
The Value type that contains a field descriptor and its value.
  • Method Details

    • messageValue

      @Nullable public com.google.protobuf.Message messageValue()
      Description copied from interface: Value
      Get the underlying value as a Message type.
      Specified by:
      messageValue in interface Value
      Returns:
      The underlying Message value. null if the underlying value is not a Message type.
    • value

      public <T> T value(Class<T> clazz)
      Description copied from interface: Value
      Get the underlying value and cast it to the class type.
      Specified by:
      value in interface Value
      Type Parameters:
      T - The class type.
      Parameters:
      clazz - The inferred class.
      Returns:
      The value casted to the inferred class type.
    • repeatedValue

      public List<Value> repeatedValue()
      Description copied from interface: Value
      Get the underlying value as a list.
      Specified by:
      repeatedValue in interface Value
      Returns:
      The underlying value as a list. Empty list is returned if the underlying type is not a list.
    • mapValue

      public Map<Value,Value> mapValue()
      Description copied from interface: Value
      Get the underlying value as a map.
      Specified by:
      mapValue in interface Value
      Returns:
      The underlying value as a map. Empty map is returned if the underlying type is not a list.