Class DescriptorMappings

java.lang.Object
build.buf.protovalidate.internal.constraints.DescriptorMappings

public final class DescriptorMappings extends Object
DescriptorMappings provides mappings between protocol buffer descriptors and CEL declarations.
  • Method Details

    • expectedWrapperConstraints

      @Nullable public static com.google.protobuf.Descriptors.FieldDescriptor expectedWrapperConstraints(String fqn)
      Returns the FieldConstraints field that is expected for the given protocol buffer field kind.
      Parameters:
      fqn - Fully qualified name of protobuf value wrapper.
      Returns:
      The constraints field descriptor for the specified wrapper fully qualified name.
    • protoKindToCELType

      public static com.google.api.expr.v1alpha1.Type protoKindToCELType(com.google.protobuf.Descriptors.FieldDescriptor.Type kind)
      Maps a Descriptors.FieldDescriptor.Type to a compatible Type.
      Parameters:
      kind - The protobuf field type.
      Returns:
      The corresponding CEL type for the protobuf field.