Package build.buf.validate
Interface MapRulesOrBuilder
- All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder
- All Known Implementing Classes:
MapRules,MapRules.Builder
public interface MapRulesOrBuilder
extends com.google.protobuf.MessageOrBuilder
-
Method Summary
Modifier and TypeMethodDescriptiongetKeys()Specifies the constraints to be applied to each key in the field.Specifies the constraints to be applied to each key in the field.longSpecifies the maximum number of key-value pairs allowed.longSpecifies the minimum number of key-value pairs allowed.Specifies the constraints to be applied to the value of each key in the field.Specifies the constraints to be applied to the value of each key in the field.booleanhasKeys()Specifies the constraints to be applied to each key in the field.booleanSpecifies the maximum number of key-value pairs allowed.booleanSpecifies the minimum number of key-value pairs allowed.booleanSpecifies the constraints to be applied to the value of each key in the field.Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
isInitializedMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
hasMinPairs
boolean hasMinPairs()Specifies the minimum number of key-value pairs allowed. If the field has fewer key-value pairs than specified, an error message is generated. ```proto message MyMap { // The field `value` must have at least 2 key-value pairs. map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2]; } ```optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... }- Returns:
- Whether the minPairs field is set.
-
getMinPairs
long getMinPairs()Specifies the minimum number of key-value pairs allowed. If the field has fewer key-value pairs than specified, an error message is generated. ```proto message MyMap { // The field `value` must have at least 2 key-value pairs. map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2]; } ```optional uint64 min_pairs = 1 [json_name = "minPairs", (.buf.validate.priv.field) = { ... }- Returns:
- The minPairs.
-
hasMaxPairs
boolean hasMaxPairs()Specifies the maximum number of key-value pairs allowed. If the field has more key-value pairs than specified, an error message is generated. ```proto message MyMap { // The field `value` must have at most 3 key-value pairs. map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3]; } ```optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... }- Returns:
- Whether the maxPairs field is set.
-
getMaxPairs
long getMaxPairs()Specifies the maximum number of key-value pairs allowed. If the field has more key-value pairs than specified, an error message is generated. ```proto message MyMap { // The field `value` must have at most 3 key-value pairs. map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3]; } ```optional uint64 max_pairs = 2 [json_name = "maxPairs", (.buf.validate.priv.field) = { ... }- Returns:
- The maxPairs.
-
hasKeys
boolean hasKeys()Specifies the constraints to be applied to each key in the field. ```proto message MyMap { // The keys in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.keys = { string: { min_len: 3 max_len: 10 } }]; } ```optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"];- Returns:
- Whether the keys field is set.
-
getKeys
FieldConstraints getKeys()Specifies the constraints to be applied to each key in the field. ```proto message MyMap { // The keys in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.keys = { string: { min_len: 3 max_len: 10 } }]; } ```optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"];- Returns:
- The keys.
-
getKeysOrBuilder
FieldConstraintsOrBuilder getKeysOrBuilder()Specifies the constraints to be applied to each key in the field. ```proto message MyMap { // The keys in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.keys = { string: { min_len: 3 max_len: 10 } }]; } ```optional .buf.validate.FieldConstraints keys = 4 [json_name = "keys"]; -
hasValues
boolean hasValues()Specifies the constraints to be applied to the value of each key in the field. Message values will still have their validations evaluated unless skip is specified here. ```proto message MyMap { // The values in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.values = { string: { min_len: 5 max_len: 20 } }]; } ```optional .buf.validate.FieldConstraints values = 5 [json_name = "values"];- Returns:
- Whether the values field is set.
-
getValues
FieldConstraints getValues()Specifies the constraints to be applied to the value of each key in the field. Message values will still have their validations evaluated unless skip is specified here. ```proto message MyMap { // The values in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.values = { string: { min_len: 5 max_len: 20 } }]; } ```optional .buf.validate.FieldConstraints values = 5 [json_name = "values"];- Returns:
- The values.
-
getValuesOrBuilder
FieldConstraintsOrBuilder getValuesOrBuilder()Specifies the constraints to be applied to the value of each key in the field. Message values will still have their validations evaluated unless skip is specified here. ```proto message MyMap { // The values in the field `value` must follow the specified constraints. map<string, string> value = 1 [(buf.validate.field).map.values = { string: { min_len: 5 max_len: 20 } }]; } ```optional .buf.validate.FieldConstraints values = 5 [json_name = "values"];
-