Package io.envoyproxy.envoy.type.v3
Class TokenBucket.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<TokenBucket.Builder>
com.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
io.envoyproxy.envoy.type.v3.TokenBucket.Builder
- All Implemented Interfaces:
com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,TokenBucketOrBuilder
,Cloneable
- Enclosing class:
TokenBucket
public static final class TokenBucket.Builder
extends com.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
implements TokenBucketOrBuilder
Configures a token bucket, typically used for rate limiting.Protobuf type
envoy.type.v3.TokenBucket
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private com.google.protobuf.Duration
private com.google.protobuf.SingleFieldBuilder
<com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> private int
private com.google.protobuf.UInt32Value
private com.google.protobuf.SingleFieldBuilder
<com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
private void
buildPartial0
(TokenBucket result) clear()
The fill interval that tokens are added to the bucket.The maximum tokens that the bucket can hold.The number of tokens added to the bucket during each fill interval.static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Duration
The fill interval that tokens are added to the bucket.com.google.protobuf.Duration.Builder
The fill interval that tokens are added to the bucket.private com.google.protobuf.SingleFieldBuilder
<com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> The fill interval that tokens are added to the bucket.com.google.protobuf.DurationOrBuilder
The fill interval that tokens are added to the bucket.int
The maximum tokens that the bucket can hold.com.google.protobuf.UInt32Value
The number of tokens added to the bucket during each fill interval.com.google.protobuf.UInt32Value.Builder
The number of tokens added to the bucket during each fill interval.private com.google.protobuf.SingleFieldBuilder
<com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> The number of tokens added to the bucket during each fill interval.com.google.protobuf.UInt32ValueOrBuilder
The number of tokens added to the bucket during each fill interval.boolean
The fill interval that tokens are added to the bucket.boolean
The number of tokens added to the bucket during each fill interval.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
private void
mergeFillInterval
(com.google.protobuf.Duration value) The fill interval that tokens are added to the bucket.mergeFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom
(com.google.protobuf.Message other) mergeFrom
(TokenBucket other) mergeTokensPerFill
(com.google.protobuf.UInt32Value value) The number of tokens added to the bucket during each fill interval.setFillInterval
(com.google.protobuf.Duration value) The fill interval that tokens are added to the bucket.setFillInterval
(com.google.protobuf.Duration.Builder builderForValue) The fill interval that tokens are added to the bucket.setMaxTokens
(int value) The maximum tokens that the bucket can hold.setTokensPerFill
(com.google.protobuf.UInt32Value value) The number of tokens added to the bucket during each fill interval.setTokensPerFill
(com.google.protobuf.UInt32Value.Builder builderForValue) The number of tokens added to the bucket during each fill interval.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
bitField0_
private int bitField0_ -
maxTokens_
private int maxTokens_ -
tokensPerFill_
private com.google.protobuf.UInt32Value tokensPerFill_ -
tokensPerFillBuilder_
private com.google.protobuf.SingleFieldBuilder<com.google.protobuf.UInt32Value,com.google.protobuf.UInt32Value.Builder, tokensPerFillBuilder_com.google.protobuf.UInt32ValueOrBuilder> -
fillInterval_
private com.google.protobuf.Duration fillInterval_ -
fillIntervalBuilder_
private com.google.protobuf.SingleFieldBuilder<com.google.protobuf.Duration,com.google.protobuf.Duration.Builder, fillIntervalBuilder_com.google.protobuf.DurationOrBuilder>
-
-
Constructor Details
-
Builder
private Builder() -
Builder
private Builder(com.google.protobuf.AbstractMessage.BuilderParent parent)
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
-
maybeForceBuilderInitialization
private void maybeForceBuilderInitialization() -
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial0
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<TokenBucket.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage.Builder<TokenBucket.Builder>
-
mergeFrom
public TokenBucket.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<TokenBucket.Builder>
- Throws:
IOException
-
getMaxTokens
public int getMaxTokens()The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket initially contains.
uint32 max_tokens = 1 [(.validate.rules) = { ... }
- Specified by:
getMaxTokens
in interfaceTokenBucketOrBuilder
- Returns:
- The maxTokens.
-
setMaxTokens
The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket initially contains.
uint32 max_tokens = 1 [(.validate.rules) = { ... }
- Parameters:
value
- The maxTokens to set.- Returns:
- This builder for chaining.
-
clearMaxTokens
The maximum tokens that the bucket can hold. This is also the number of tokens that the bucket initially contains.
uint32 max_tokens = 1 [(.validate.rules) = { ... }
- Returns:
- This builder for chaining.
-
hasTokensPerFill
public boolean hasTokensPerFill()The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
- Specified by:
hasTokensPerFill
in interfaceTokenBucketOrBuilder
- Returns:
- Whether the tokensPerFill field is set.
-
getTokensPerFill
public com.google.protobuf.UInt32Value getTokensPerFill()The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
- Specified by:
getTokensPerFill
in interfaceTokenBucketOrBuilder
- Returns:
- The tokensPerFill.
-
setTokensPerFill
The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
setTokensPerFill
public TokenBucket.Builder setTokensPerFill(com.google.protobuf.UInt32Value.Builder builderForValue) The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
mergeTokensPerFill
The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
clearTokensPerFill
The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
getTokensPerFillBuilder
public com.google.protobuf.UInt32Value.Builder getTokensPerFillBuilder()The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
getTokensPerFillOrBuilder
public com.google.protobuf.UInt32ValueOrBuilder getTokensPerFillOrBuilder()The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
- Specified by:
getTokensPerFillOrBuilder
in interfaceTokenBucketOrBuilder
-
getTokensPerFillFieldBuilder
private com.google.protobuf.SingleFieldBuilder<com.google.protobuf.UInt32Value,com.google.protobuf.UInt32Value.Builder, getTokensPerFillFieldBuilder()com.google.protobuf.UInt32ValueOrBuilder> The number of tokens added to the bucket during each fill interval. If not specified, defaults to a single token.
.google.protobuf.UInt32Value tokens_per_fill = 2 [(.validate.rules) = { ... }
-
hasFillInterval
public boolean hasFillInterval()The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
- Specified by:
hasFillInterval
in interfaceTokenBucketOrBuilder
- Returns:
- Whether the fillInterval field is set.
-
getFillInterval
public com.google.protobuf.Duration getFillInterval()The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
- Specified by:
getFillInterval
in interfaceTokenBucketOrBuilder
- Returns:
- The fillInterval.
-
setFillInterval
The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-
setFillInterval
The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-
mergeFillInterval
The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-
clearFillInterval
The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-
getFillIntervalBuilder
public com.google.protobuf.Duration.Builder getFillIntervalBuilder()The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-
getFillIntervalOrBuilder
public com.google.protobuf.DurationOrBuilder getFillIntervalOrBuilder()The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
- Specified by:
getFillIntervalOrBuilder
in interfaceTokenBucketOrBuilder
-
getFillIntervalFieldBuilder
private com.google.protobuf.SingleFieldBuilder<com.google.protobuf.Duration,com.google.protobuf.Duration.Builder, getFillIntervalFieldBuilder()com.google.protobuf.DurationOrBuilder> The fill interval that tokens are added to the bucket. During each fill interval ``tokens_per_fill`` are added to the bucket. The bucket will never contain more than ``max_tokens`` tokens.
.google.protobuf.Duration fill_interval = 3 [(.validate.rules) = { ... }
-