Class DescriptorMappings
java.lang.Object
build.buf.protovalidate.internal.constraints.DescriptorMappings
DescriptorMappings provides mappings between protocol buffer descriptors and CEL declarations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.protobuf.Descriptors.FieldDescriptorReturns theFieldConstraintsfield that is expected for the given protocol buffer field kind.static com.google.api.expr.v1alpha1.TypeprotoKindToCELType(com.google.protobuf.Descriptors.FieldDescriptor.Type kind) Maps aDescriptors.FieldDescriptor.Typeto a compatibleType.
-
Method Details
-
expectedWrapperConstraints
@Nullable public static com.google.protobuf.Descriptors.FieldDescriptor expectedWrapperConstraints(String fqn) Returns theFieldConstraintsfield 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 aDescriptors.FieldDescriptor.Typeto a compatibleType.- Parameters:
kind- The protobuf field type.- Returns:
- The corresponding CEL type for the protobuf field.
-