it.ratelim.data.RateLimitProtos Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ratelimit-java Show documentation
Show all versions of ratelimit-java Show documentation
API Client for http://www.ratelim.it: rate limits, feature flags and semaphores as a service
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: ratelimit.proto
package it.ratelim.data;
public final class RateLimitProtos {
private RateLimitProtos() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
public interface LimitResponseOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional bool passed = 1 [default = true];
boolean hasPassed();
boolean getPassed();
// optional int64 expires_at = 2;
boolean hasExpiresAt();
long getExpiresAt();
// optional string enforced_group = 3;
boolean hasEnforcedGroup();
String getEnforcedGroup();
// optional int64 current_bucket = 4;
boolean hasCurrentBucket();
long getCurrentBucket();
// optional string policy_group = 5;
boolean hasPolicyGroup();
String getPolicyGroup();
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 6;
boolean hasPolicyName();
it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName();
// optional int32 policy_limit = 7;
boolean hasPolicyLimit();
int getPolicyLimit();
// optional int64 amount = 8 [default = 1];
boolean hasAmount();
long getAmount();
// optional int64 limit_reset_at = 9;
boolean hasLimitResetAt();
long getLimitResetAt();
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 10;
boolean hasSafetyLevel();
it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel();
}
public static final class LimitResponse extends
com.google.protobuf.GeneratedMessage
implements LimitResponseOrBuilder {
// Use LimitResponse.newBuilder() to construct.
private LimitResponse(Builder builder) {
super(builder);
}
private LimitResponse(boolean noInit) {}
private static final LimitResponse defaultInstance;
public static LimitResponse getDefaultInstance() {
return defaultInstance;
}
public LimitResponse getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitResponse_fieldAccessorTable;
}
public enum LimitPolicyNames
implements com.google.protobuf.ProtocolMessageEnum {
SECONDLY(0, 1),
MINUTELY(1, 2),
MINUTELY_ROLLING(2, 3),
HOURLY(3, 4),
HOURLY_ROLLING(4, 5),
DAILY(5, 6),
DAILY_ROLLING(6, 7),
MONTHLY(7, 8),
INFINITE(8, 9),
;
public static final int SECONDLY_VALUE = 1;
public static final int MINUTELY_VALUE = 2;
public static final int MINUTELY_ROLLING_VALUE = 3;
public static final int HOURLY_VALUE = 4;
public static final int HOURLY_ROLLING_VALUE = 5;
public static final int DAILY_VALUE = 6;
public static final int DAILY_ROLLING_VALUE = 7;
public static final int MONTHLY_VALUE = 8;
public static final int INFINITE_VALUE = 9;
public final int getNumber() { return value; }
public static LimitPolicyNames valueOf(int value) {
switch (value) {
case 1: return SECONDLY;
case 2: return MINUTELY;
case 3: return MINUTELY_ROLLING;
case 4: return HOURLY;
case 5: return HOURLY_ROLLING;
case 6: return DAILY;
case 7: return DAILY_ROLLING;
case 8: return MONTHLY;
case 9: return INFINITE;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public LimitPolicyNames findValueByNumber(int number) {
return LimitPolicyNames.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.LimitResponse.getDescriptor().getEnumTypes().get(0);
}
private static final LimitPolicyNames[] VALUES = {
SECONDLY, MINUTELY, MINUTELY_ROLLING, HOURLY, HOURLY_ROLLING, DAILY, DAILY_ROLLING, MONTHLY, INFINITE,
};
public static LimitPolicyNames valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private LimitPolicyNames(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:it.ratelim.data.LimitResponse.LimitPolicyNames)
}
private int bitField0_;
// optional bool passed = 1 [default = true];
public static final int PASSED_FIELD_NUMBER = 1;
private boolean passed_;
public boolean hasPassed() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public boolean getPassed() {
return passed_;
}
// optional int64 expires_at = 2;
public static final int EXPIRES_AT_FIELD_NUMBER = 2;
private long expiresAt_;
public boolean hasExpiresAt() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public long getExpiresAt() {
return expiresAt_;
}
// optional string enforced_group = 3;
public static final int ENFORCED_GROUP_FIELD_NUMBER = 3;
private java.lang.Object enforcedGroup_;
public boolean hasEnforcedGroup() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public String getEnforcedGroup() {
java.lang.Object ref = enforcedGroup_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
enforcedGroup_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getEnforcedGroupBytes() {
java.lang.Object ref = enforcedGroup_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
enforcedGroup_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional int64 current_bucket = 4;
public static final int CURRENT_BUCKET_FIELD_NUMBER = 4;
private long currentBucket_;
public boolean hasCurrentBucket() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public long getCurrentBucket() {
return currentBucket_;
}
// optional string policy_group = 5;
public static final int POLICY_GROUP_FIELD_NUMBER = 5;
private java.lang.Object policyGroup_;
public boolean hasPolicyGroup() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public String getPolicyGroup() {
java.lang.Object ref = policyGroup_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
policyGroup_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getPolicyGroupBytes() {
java.lang.Object ref = policyGroup_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
policyGroup_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 6;
public static final int POLICY_NAME_FIELD_NUMBER = 6;
private it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames policyName_;
public boolean hasPolicyName() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName() {
return policyName_;
}
// optional int32 policy_limit = 7;
public static final int POLICY_LIMIT_FIELD_NUMBER = 7;
private int policyLimit_;
public boolean hasPolicyLimit() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public int getPolicyLimit() {
return policyLimit_;
}
// optional int64 amount = 8 [default = 1];
public static final int AMOUNT_FIELD_NUMBER = 8;
private long amount_;
public boolean hasAmount() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
public long getAmount() {
return amount_;
}
// optional int64 limit_reset_at = 9;
public static final int LIMIT_RESET_AT_FIELD_NUMBER = 9;
private long limitResetAt_;
public boolean hasLimitResetAt() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
public long getLimitResetAt() {
return limitResetAt_;
}
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 10;
public static final int SAFETY_LEVEL_FIELD_NUMBER = 10;
private it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel safetyLevel_;
public boolean hasSafetyLevel() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel() {
return safetyLevel_;
}
private void initFields() {
passed_ = true;
expiresAt_ = 0L;
enforcedGroup_ = "";
currentBucket_ = 0L;
policyGroup_ = "";
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
policyLimit_ = 0;
amount_ = 1L;
limitResetAt_ = 0L;
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBool(1, passed_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt64(2, expiresAt_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeBytes(3, getEnforcedGroupBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt64(4, currentBucket_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBytes(5, getPolicyGroupBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeEnum(6, policyName_.getNumber());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeInt32(7, policyLimit_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeInt64(8, amount_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
output.writeInt64(9, limitResetAt_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
output.writeEnum(10, safetyLevel_.getNumber());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(1, passed_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, expiresAt_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(3, getEnforcedGroupBytes());
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(4, currentBucket_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getPolicyGroupBytes());
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(6, policyName_.getNumber());
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(7, policyLimit_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(8, amount_);
}
if (((bitField0_ & 0x00000100) == 0x00000100)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(9, limitResetAt_);
}
if (((bitField0_ & 0x00000200) == 0x00000200)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(10, safetyLevel_.getNumber());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.LimitResponse prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.LimitResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitResponse_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.LimitResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
passed_ = true;
bitField0_ = (bitField0_ & ~0x00000001);
expiresAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00000002);
enforcedGroup_ = "";
bitField0_ = (bitField0_ & ~0x00000004);
currentBucket_ = 0L;
bitField0_ = (bitField0_ & ~0x00000008);
policyGroup_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
bitField0_ = (bitField0_ & ~0x00000020);
policyLimit_ = 0;
bitField0_ = (bitField0_ & ~0x00000040);
amount_ = 1L;
bitField0_ = (bitField0_ & ~0x00000080);
limitResetAt_ = 0L;
bitField0_ = (bitField0_ & ~0x00000100);
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
bitField0_ = (bitField0_ & ~0x00000200);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.LimitResponse.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.LimitResponse getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.LimitResponse.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.LimitResponse build() {
it.ratelim.data.RateLimitProtos.LimitResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.LimitResponse buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.LimitResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.LimitResponse buildPartial() {
it.ratelim.data.RateLimitProtos.LimitResponse result = new it.ratelim.data.RateLimitProtos.LimitResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.passed_ = passed_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.expiresAt_ = expiresAt_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.enforcedGroup_ = enforcedGroup_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.currentBucket_ = currentBucket_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.policyGroup_ = policyGroup_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.policyName_ = policyName_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.policyLimit_ = policyLimit_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.amount_ = amount_;
if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
to_bitField0_ |= 0x00000100;
}
result.limitResetAt_ = limitResetAt_;
if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
to_bitField0_ |= 0x00000200;
}
result.safetyLevel_ = safetyLevel_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.LimitResponse) {
return mergeFrom((it.ratelim.data.RateLimitProtos.LimitResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.LimitResponse other) {
if (other == it.ratelim.data.RateLimitProtos.LimitResponse.getDefaultInstance()) return this;
if (other.hasPassed()) {
setPassed(other.getPassed());
}
if (other.hasExpiresAt()) {
setExpiresAt(other.getExpiresAt());
}
if (other.hasEnforcedGroup()) {
setEnforcedGroup(other.getEnforcedGroup());
}
if (other.hasCurrentBucket()) {
setCurrentBucket(other.getCurrentBucket());
}
if (other.hasPolicyGroup()) {
setPolicyGroup(other.getPolicyGroup());
}
if (other.hasPolicyName()) {
setPolicyName(other.getPolicyName());
}
if (other.hasPolicyLimit()) {
setPolicyLimit(other.getPolicyLimit());
}
if (other.hasAmount()) {
setAmount(other.getAmount());
}
if (other.hasLimitResetAt()) {
setLimitResetAt(other.getLimitResetAt());
}
if (other.hasSafetyLevel()) {
setSafetyLevel(other.getSafetyLevel());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
passed_ = input.readBool();
break;
}
case 16: {
bitField0_ |= 0x00000002;
expiresAt_ = input.readInt64();
break;
}
case 26: {
bitField0_ |= 0x00000004;
enforcedGroup_ = input.readBytes();
break;
}
case 32: {
bitField0_ |= 0x00000008;
currentBucket_ = input.readInt64();
break;
}
case 42: {
bitField0_ |= 0x00000010;
policyGroup_ = input.readBytes();
break;
}
case 48: {
int rawValue = input.readEnum();
it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames value = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(6, rawValue);
} else {
bitField0_ |= 0x00000020;
policyName_ = value;
}
break;
}
case 56: {
bitField0_ |= 0x00000040;
policyLimit_ = input.readInt32();
break;
}
case 64: {
bitField0_ |= 0x00000080;
amount_ = input.readInt64();
break;
}
case 72: {
bitField0_ |= 0x00000100;
limitResetAt_ = input.readInt64();
break;
}
case 80: {
int rawValue = input.readEnum();
it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel value = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(10, rawValue);
} else {
bitField0_ |= 0x00000200;
safetyLevel_ = value;
}
break;
}
}
}
}
private int bitField0_;
// optional bool passed = 1 [default = true];
private boolean passed_ = true;
public boolean hasPassed() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public boolean getPassed() {
return passed_;
}
public Builder setPassed(boolean value) {
bitField0_ |= 0x00000001;
passed_ = value;
onChanged();
return this;
}
public Builder clearPassed() {
bitField0_ = (bitField0_ & ~0x00000001);
passed_ = true;
onChanged();
return this;
}
// optional int64 expires_at = 2;
private long expiresAt_ ;
public boolean hasExpiresAt() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public long getExpiresAt() {
return expiresAt_;
}
public Builder setExpiresAt(long value) {
bitField0_ |= 0x00000002;
expiresAt_ = value;
onChanged();
return this;
}
public Builder clearExpiresAt() {
bitField0_ = (bitField0_ & ~0x00000002);
expiresAt_ = 0L;
onChanged();
return this;
}
// optional string enforced_group = 3;
private java.lang.Object enforcedGroup_ = "";
public boolean hasEnforcedGroup() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public String getEnforcedGroup() {
java.lang.Object ref = enforcedGroup_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
enforcedGroup_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setEnforcedGroup(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
enforcedGroup_ = value;
onChanged();
return this;
}
public Builder clearEnforcedGroup() {
bitField0_ = (bitField0_ & ~0x00000004);
enforcedGroup_ = getDefaultInstance().getEnforcedGroup();
onChanged();
return this;
}
void setEnforcedGroup(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000004;
enforcedGroup_ = value;
onChanged();
}
// optional int64 current_bucket = 4;
private long currentBucket_ ;
public boolean hasCurrentBucket() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public long getCurrentBucket() {
return currentBucket_;
}
public Builder setCurrentBucket(long value) {
bitField0_ |= 0x00000008;
currentBucket_ = value;
onChanged();
return this;
}
public Builder clearCurrentBucket() {
bitField0_ = (bitField0_ & ~0x00000008);
currentBucket_ = 0L;
onChanged();
return this;
}
// optional string policy_group = 5;
private java.lang.Object policyGroup_ = "";
public boolean hasPolicyGroup() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public String getPolicyGroup() {
java.lang.Object ref = policyGroup_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
policyGroup_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setPolicyGroup(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
policyGroup_ = value;
onChanged();
return this;
}
public Builder clearPolicyGroup() {
bitField0_ = (bitField0_ & ~0x00000010);
policyGroup_ = getDefaultInstance().getPolicyGroup();
onChanged();
return this;
}
void setPolicyGroup(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000010;
policyGroup_ = value;
onChanged();
}
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 6;
private it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
public boolean hasPolicyName() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName() {
return policyName_;
}
public Builder setPolicyName(it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
policyName_ = value;
onChanged();
return this;
}
public Builder clearPolicyName() {
bitField0_ = (bitField0_ & ~0x00000020);
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
onChanged();
return this;
}
// optional int32 policy_limit = 7;
private int policyLimit_ ;
public boolean hasPolicyLimit() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public int getPolicyLimit() {
return policyLimit_;
}
public Builder setPolicyLimit(int value) {
bitField0_ |= 0x00000040;
policyLimit_ = value;
onChanged();
return this;
}
public Builder clearPolicyLimit() {
bitField0_ = (bitField0_ & ~0x00000040);
policyLimit_ = 0;
onChanged();
return this;
}
// optional int64 amount = 8 [default = 1];
private long amount_ = 1L;
public boolean hasAmount() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
public long getAmount() {
return amount_;
}
public Builder setAmount(long value) {
bitField0_ |= 0x00000080;
amount_ = value;
onChanged();
return this;
}
public Builder clearAmount() {
bitField0_ = (bitField0_ & ~0x00000080);
amount_ = 1L;
onChanged();
return this;
}
// optional int64 limit_reset_at = 9;
private long limitResetAt_ ;
public boolean hasLimitResetAt() {
return ((bitField0_ & 0x00000100) == 0x00000100);
}
public long getLimitResetAt() {
return limitResetAt_;
}
public Builder setLimitResetAt(long value) {
bitField0_ |= 0x00000100;
limitResetAt_ = value;
onChanged();
return this;
}
public Builder clearLimitResetAt() {
bitField0_ = (bitField0_ & ~0x00000100);
limitResetAt_ = 0L;
onChanged();
return this;
}
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 10;
private it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
public boolean hasSafetyLevel() {
return ((bitField0_ & 0x00000200) == 0x00000200);
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel() {
return safetyLevel_;
}
public Builder setSafetyLevel(it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000200;
safetyLevel_ = value;
onChanged();
return this;
}
public Builder clearSafetyLevel() {
bitField0_ = (bitField0_ & ~0x00000200);
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.LimitResponse)
}
static {
defaultInstance = new LimitResponse(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.LimitResponse)
}
public interface LimitRequestOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional int64 account_id = 1;
boolean hasAccountId();
long getAccountId();
// optional bytes partition_key = 2;
boolean hasPartitionKey();
com.google.protobuf.ByteString getPartitionKey();
// optional int32 acquire_amount = 3 [default = 1];
boolean hasAcquireAmount();
int getAcquireAmount();
// repeated string groups = 4;
java.util.List getGroupsList();
int getGroupsCount();
String getGroups(int index);
// optional .it.ratelim.data.LimitRequest.LimitCombiner limit_combiner = 5 [default = MAXIMUM];
boolean hasLimitCombiner();
it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner getLimitCombiner();
// optional bool persist_request = 7 [default = true];
boolean hasPersistRequest();
boolean getPersistRequest();
// optional bool allow_partial_response = 8 [default = false];
boolean hasAllowPartialResponse();
boolean getAllowPartialResponse();
}
public static final class LimitRequest extends
com.google.protobuf.GeneratedMessage
implements LimitRequestOrBuilder {
// Use LimitRequest.newBuilder() to construct.
private LimitRequest(Builder builder) {
super(builder);
}
private LimitRequest(boolean noInit) {}
private static final LimitRequest defaultInstance;
public static LimitRequest getDefaultInstance() {
return defaultInstance;
}
public LimitRequest getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitRequest_fieldAccessorTable;
}
public enum LimitCombiner
implements com.google.protobuf.ProtocolMessageEnum {
MINIMUM(0, 1),
MAXIMUM(1, 2),
;
public static final int MINIMUM_VALUE = 1;
public static final int MAXIMUM_VALUE = 2;
public final int getNumber() { return value; }
public static LimitCombiner valueOf(int value) {
switch (value) {
case 1: return MINIMUM;
case 2: return MAXIMUM;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public LimitCombiner findValueByNumber(int number) {
return LimitCombiner.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.LimitRequest.getDescriptor().getEnumTypes().get(0);
}
private static final LimitCombiner[] VALUES = {
MINIMUM, MAXIMUM,
};
public static LimitCombiner valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private LimitCombiner(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:it.ratelim.data.LimitRequest.LimitCombiner)
}
private int bitField0_;
// optional int64 account_id = 1;
public static final int ACCOUNT_ID_FIELD_NUMBER = 1;
private long accountId_;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getAccountId() {
return accountId_;
}
// optional bytes partition_key = 2;
public static final int PARTITION_KEY_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString partitionKey_;
public boolean hasPartitionKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public com.google.protobuf.ByteString getPartitionKey() {
return partitionKey_;
}
// optional int32 acquire_amount = 3 [default = 1];
public static final int ACQUIRE_AMOUNT_FIELD_NUMBER = 3;
private int acquireAmount_;
public boolean hasAcquireAmount() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getAcquireAmount() {
return acquireAmount_;
}
// repeated string groups = 4;
public static final int GROUPS_FIELD_NUMBER = 4;
private com.google.protobuf.LazyStringList groups_;
public java.util.List
getGroupsList() {
return groups_;
}
public int getGroupsCount() {
return groups_.size();
}
public String getGroups(int index) {
return groups_.get(index);
}
// optional .it.ratelim.data.LimitRequest.LimitCombiner limit_combiner = 5 [default = MAXIMUM];
public static final int LIMIT_COMBINER_FIELD_NUMBER = 5;
private it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner limitCombiner_;
public boolean hasLimitCombiner() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner getLimitCombiner() {
return limitCombiner_;
}
// optional bool persist_request = 7 [default = true];
public static final int PERSIST_REQUEST_FIELD_NUMBER = 7;
private boolean persistRequest_;
public boolean hasPersistRequest() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public boolean getPersistRequest() {
return persistRequest_;
}
// optional bool allow_partial_response = 8 [default = false];
public static final int ALLOW_PARTIAL_RESPONSE_FIELD_NUMBER = 8;
private boolean allowPartialResponse_;
public boolean hasAllowPartialResponse() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public boolean getAllowPartialResponse() {
return allowPartialResponse_;
}
private void initFields() {
accountId_ = 0L;
partitionKey_ = com.google.protobuf.ByteString.EMPTY;
acquireAmount_ = 1;
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
limitCombiner_ = it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner.MAXIMUM;
persistRequest_ = true;
allowPartialResponse_ = false;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt64(1, accountId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, partitionKey_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, acquireAmount_);
}
for (int i = 0; i < groups_.size(); i++) {
output.writeBytes(4, groups_.getByteString(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeEnum(5, limitCombiner_.getNumber());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeBool(7, persistRequest_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeBool(8, allowPartialResponse_);
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, accountId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, partitionKey_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, acquireAmount_);
}
{
int dataSize = 0;
for (int i = 0; i < groups_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(groups_.getByteString(i));
}
size += dataSize;
size += 1 * getGroupsList().size();
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, limitCombiner_.getNumber());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, persistRequest_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(8, allowPartialResponse_);
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.LimitRequest prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.LimitRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitRequest_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.LimitRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
accountId_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
partitionKey_ = com.google.protobuf.ByteString.EMPTY;
bitField0_ = (bitField0_ & ~0x00000002);
acquireAmount_ = 1;
bitField0_ = (bitField0_ & ~0x00000004);
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
limitCombiner_ = it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner.MAXIMUM;
bitField0_ = (bitField0_ & ~0x00000010);
persistRequest_ = true;
bitField0_ = (bitField0_ & ~0x00000020);
allowPartialResponse_ = false;
bitField0_ = (bitField0_ & ~0x00000040);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.LimitRequest.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.LimitRequest getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.LimitRequest.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.LimitRequest build() {
it.ratelim.data.RateLimitProtos.LimitRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.LimitRequest buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.LimitRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.LimitRequest buildPartial() {
it.ratelim.data.RateLimitProtos.LimitRequest result = new it.ratelim.data.RateLimitProtos.LimitRequest(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.accountId_ = accountId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.partitionKey_ = partitionKey_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.acquireAmount_ = acquireAmount_;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = new com.google.protobuf.UnmodifiableLazyStringList(
groups_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.groups_ = groups_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000008;
}
result.limitCombiner_ = limitCombiner_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000010;
}
result.persistRequest_ = persistRequest_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000020;
}
result.allowPartialResponse_ = allowPartialResponse_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.LimitRequest) {
return mergeFrom((it.ratelim.data.RateLimitProtos.LimitRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.LimitRequest other) {
if (other == it.ratelim.data.RateLimitProtos.LimitRequest.getDefaultInstance()) return this;
if (other.hasAccountId()) {
setAccountId(other.getAccountId());
}
if (other.hasPartitionKey()) {
setPartitionKey(other.getPartitionKey());
}
if (other.hasAcquireAmount()) {
setAcquireAmount(other.getAcquireAmount());
}
if (!other.groups_.isEmpty()) {
if (groups_.isEmpty()) {
groups_ = other.groups_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureGroupsIsMutable();
groups_.addAll(other.groups_);
}
onChanged();
}
if (other.hasLimitCombiner()) {
setLimitCombiner(other.getLimitCombiner());
}
if (other.hasPersistRequest()) {
setPersistRequest(other.getPersistRequest());
}
if (other.hasAllowPartialResponse()) {
setAllowPartialResponse(other.getAllowPartialResponse());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
accountId_ = input.readInt64();
break;
}
case 18: {
bitField0_ |= 0x00000002;
partitionKey_ = input.readBytes();
break;
}
case 24: {
bitField0_ |= 0x00000004;
acquireAmount_ = input.readInt32();
break;
}
case 34: {
ensureGroupsIsMutable();
groups_.add(input.readBytes());
break;
}
case 40: {
int rawValue = input.readEnum();
it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner value = it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(5, rawValue);
} else {
bitField0_ |= 0x00000010;
limitCombiner_ = value;
}
break;
}
case 56: {
bitField0_ |= 0x00000020;
persistRequest_ = input.readBool();
break;
}
case 64: {
bitField0_ |= 0x00000040;
allowPartialResponse_ = input.readBool();
break;
}
}
}
}
private int bitField0_;
// optional int64 account_id = 1;
private long accountId_ ;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getAccountId() {
return accountId_;
}
public Builder setAccountId(long value) {
bitField0_ |= 0x00000001;
accountId_ = value;
onChanged();
return this;
}
public Builder clearAccountId() {
bitField0_ = (bitField0_ & ~0x00000001);
accountId_ = 0L;
onChanged();
return this;
}
// optional bytes partition_key = 2;
private com.google.protobuf.ByteString partitionKey_ = com.google.protobuf.ByteString.EMPTY;
public boolean hasPartitionKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public com.google.protobuf.ByteString getPartitionKey() {
return partitionKey_;
}
public Builder setPartitionKey(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
partitionKey_ = value;
onChanged();
return this;
}
public Builder clearPartitionKey() {
bitField0_ = (bitField0_ & ~0x00000002);
partitionKey_ = getDefaultInstance().getPartitionKey();
onChanged();
return this;
}
// optional int32 acquire_amount = 3 [default = 1];
private int acquireAmount_ = 1;
public boolean hasAcquireAmount() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getAcquireAmount() {
return acquireAmount_;
}
public Builder setAcquireAmount(int value) {
bitField0_ |= 0x00000004;
acquireAmount_ = value;
onChanged();
return this;
}
public Builder clearAcquireAmount() {
bitField0_ = (bitField0_ & ~0x00000004);
acquireAmount_ = 1;
onChanged();
return this;
}
// repeated string groups = 4;
private com.google.protobuf.LazyStringList groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureGroupsIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
groups_ = new com.google.protobuf.LazyStringArrayList(groups_);
bitField0_ |= 0x00000008;
}
}
public java.util.List
getGroupsList() {
return java.util.Collections.unmodifiableList(groups_);
}
public int getGroupsCount() {
return groups_.size();
}
public String getGroups(int index) {
return groups_.get(index);
}
public Builder setGroups(
int index, String value) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.set(index, value);
onChanged();
return this;
}
public Builder addGroups(String value) {
if (value == null) {
throw new NullPointerException();
}
ensureGroupsIsMutable();
groups_.add(value);
onChanged();
return this;
}
public Builder addAllGroups(
java.lang.Iterable values) {
ensureGroupsIsMutable();
super.addAll(values, groups_);
onChanged();
return this;
}
public Builder clearGroups() {
groups_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
void addGroups(com.google.protobuf.ByteString value) {
ensureGroupsIsMutable();
groups_.add(value);
onChanged();
}
// optional .it.ratelim.data.LimitRequest.LimitCombiner limit_combiner = 5 [default = MAXIMUM];
private it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner limitCombiner_ = it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner.MAXIMUM;
public boolean hasLimitCombiner() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner getLimitCombiner() {
return limitCombiner_;
}
public Builder setLimitCombiner(it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
limitCombiner_ = value;
onChanged();
return this;
}
public Builder clearLimitCombiner() {
bitField0_ = (bitField0_ & ~0x00000010);
limitCombiner_ = it.ratelim.data.RateLimitProtos.LimitRequest.LimitCombiner.MAXIMUM;
onChanged();
return this;
}
// optional bool persist_request = 7 [default = true];
private boolean persistRequest_ = true;
public boolean hasPersistRequest() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public boolean getPersistRequest() {
return persistRequest_;
}
public Builder setPersistRequest(boolean value) {
bitField0_ |= 0x00000020;
persistRequest_ = value;
onChanged();
return this;
}
public Builder clearPersistRequest() {
bitField0_ = (bitField0_ & ~0x00000020);
persistRequest_ = true;
onChanged();
return this;
}
// optional bool allow_partial_response = 8 [default = false];
private boolean allowPartialResponse_ ;
public boolean hasAllowPartialResponse() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public boolean getAllowPartialResponse() {
return allowPartialResponse_;
}
public Builder setAllowPartialResponse(boolean value) {
bitField0_ |= 0x00000040;
allowPartialResponse_ = value;
onChanged();
return this;
}
public Builder clearAllowPartialResponse() {
bitField0_ = (bitField0_ & ~0x00000040);
allowPartialResponse_ = false;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.LimitRequest)
}
static {
defaultInstance = new LimitRequest(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.LimitRequest)
}
public interface FeatureFlagOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional int64 account_id = 1;
boolean hasAccountId();
long getAccountId();
// optional string feature = 2;
boolean hasFeature();
String getFeature();
// optional double pct = 3 [default = 0];
boolean hasPct();
double getPct();
// repeated string whitelisted = 4;
java.util.List getWhitelistedList();
int getWhitelistedCount();
String getWhitelisted(int index);
// optional string prior_feature_name = 5;
boolean hasPriorFeatureName();
String getPriorFeatureName();
}
public static final class FeatureFlag extends
com.google.protobuf.GeneratedMessage
implements FeatureFlagOrBuilder {
// Use FeatureFlag.newBuilder() to construct.
private FeatureFlag(Builder builder) {
super(builder);
}
private FeatureFlag(boolean noInit) {}
private static final FeatureFlag defaultInstance;
public static FeatureFlag getDefaultInstance() {
return defaultInstance;
}
public FeatureFlag getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlag_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlag_fieldAccessorTable;
}
private int bitField0_;
// optional int64 account_id = 1;
public static final int ACCOUNT_ID_FIELD_NUMBER = 1;
private long accountId_;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getAccountId() {
return accountId_;
}
// optional string feature = 2;
public static final int FEATURE_FIELD_NUMBER = 2;
private java.lang.Object feature_;
public boolean hasFeature() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public String getFeature() {
java.lang.Object ref = feature_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
feature_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getFeatureBytes() {
java.lang.Object ref = feature_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
feature_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional double pct = 3 [default = 0];
public static final int PCT_FIELD_NUMBER = 3;
private double pct_;
public boolean hasPct() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public double getPct() {
return pct_;
}
// repeated string whitelisted = 4;
public static final int WHITELISTED_FIELD_NUMBER = 4;
private com.google.protobuf.LazyStringList whitelisted_;
public java.util.List
getWhitelistedList() {
return whitelisted_;
}
public int getWhitelistedCount() {
return whitelisted_.size();
}
public String getWhitelisted(int index) {
return whitelisted_.get(index);
}
// optional string prior_feature_name = 5;
public static final int PRIOR_FEATURE_NAME_FIELD_NUMBER = 5;
private java.lang.Object priorFeatureName_;
public boolean hasPriorFeatureName() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public String getPriorFeatureName() {
java.lang.Object ref = priorFeatureName_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
priorFeatureName_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getPriorFeatureNameBytes() {
java.lang.Object ref = priorFeatureName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
priorFeatureName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
accountId_ = 0L;
feature_ = "";
pct_ = 0D;
whitelisted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
priorFeatureName_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt64(1, accountId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getFeatureBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeDouble(3, pct_);
}
for (int i = 0; i < whitelisted_.size(); i++) {
output.writeBytes(4, whitelisted_.getByteString(i));
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeBytes(5, getPriorFeatureNameBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, accountId_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getFeatureBytes());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(3, pct_);
}
{
int dataSize = 0;
for (int i = 0; i < whitelisted_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeBytesSizeNoTag(whitelisted_.getByteString(i));
}
size += dataSize;
size += 1 * getWhitelistedList().size();
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(5, getPriorFeatureNameBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlag parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.FeatureFlag prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlag_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlag_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.FeatureFlag.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
accountId_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
feature_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
pct_ = 0D;
bitField0_ = (bitField0_ & ~0x00000004);
whitelisted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
priorFeatureName_ = "";
bitField0_ = (bitField0_ & ~0x00000010);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.FeatureFlag.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.FeatureFlag getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.FeatureFlag.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.FeatureFlag build() {
it.ratelim.data.RateLimitProtos.FeatureFlag result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.FeatureFlag buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.FeatureFlag result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.FeatureFlag buildPartial() {
it.ratelim.data.RateLimitProtos.FeatureFlag result = new it.ratelim.data.RateLimitProtos.FeatureFlag(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.accountId_ = accountId_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.feature_ = feature_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.pct_ = pct_;
if (((bitField0_ & 0x00000008) == 0x00000008)) {
whitelisted_ = new com.google.protobuf.UnmodifiableLazyStringList(
whitelisted_);
bitField0_ = (bitField0_ & ~0x00000008);
}
result.whitelisted_ = whitelisted_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000008;
}
result.priorFeatureName_ = priorFeatureName_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.FeatureFlag) {
return mergeFrom((it.ratelim.data.RateLimitProtos.FeatureFlag)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.FeatureFlag other) {
if (other == it.ratelim.data.RateLimitProtos.FeatureFlag.getDefaultInstance()) return this;
if (other.hasAccountId()) {
setAccountId(other.getAccountId());
}
if (other.hasFeature()) {
setFeature(other.getFeature());
}
if (other.hasPct()) {
setPct(other.getPct());
}
if (!other.whitelisted_.isEmpty()) {
if (whitelisted_.isEmpty()) {
whitelisted_ = other.whitelisted_;
bitField0_ = (bitField0_ & ~0x00000008);
} else {
ensureWhitelistedIsMutable();
whitelisted_.addAll(other.whitelisted_);
}
onChanged();
}
if (other.hasPriorFeatureName()) {
setPriorFeatureName(other.getPriorFeatureName());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
accountId_ = input.readInt64();
break;
}
case 18: {
bitField0_ |= 0x00000002;
feature_ = input.readBytes();
break;
}
case 25: {
bitField0_ |= 0x00000004;
pct_ = input.readDouble();
break;
}
case 34: {
ensureWhitelistedIsMutable();
whitelisted_.add(input.readBytes());
break;
}
case 42: {
bitField0_ |= 0x00000010;
priorFeatureName_ = input.readBytes();
break;
}
}
}
}
private int bitField0_;
// optional int64 account_id = 1;
private long accountId_ ;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getAccountId() {
return accountId_;
}
public Builder setAccountId(long value) {
bitField0_ |= 0x00000001;
accountId_ = value;
onChanged();
return this;
}
public Builder clearAccountId() {
bitField0_ = (bitField0_ & ~0x00000001);
accountId_ = 0L;
onChanged();
return this;
}
// optional string feature = 2;
private java.lang.Object feature_ = "";
public boolean hasFeature() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public String getFeature() {
java.lang.Object ref = feature_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
feature_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setFeature(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
feature_ = value;
onChanged();
return this;
}
public Builder clearFeature() {
bitField0_ = (bitField0_ & ~0x00000002);
feature_ = getDefaultInstance().getFeature();
onChanged();
return this;
}
void setFeature(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000002;
feature_ = value;
onChanged();
}
// optional double pct = 3 [default = 0];
private double pct_ ;
public boolean hasPct() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public double getPct() {
return pct_;
}
public Builder setPct(double value) {
bitField0_ |= 0x00000004;
pct_ = value;
onChanged();
return this;
}
public Builder clearPct() {
bitField0_ = (bitField0_ & ~0x00000004);
pct_ = 0D;
onChanged();
return this;
}
// repeated string whitelisted = 4;
private com.google.protobuf.LazyStringList whitelisted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureWhitelistedIsMutable() {
if (!((bitField0_ & 0x00000008) == 0x00000008)) {
whitelisted_ = new com.google.protobuf.LazyStringArrayList(whitelisted_);
bitField0_ |= 0x00000008;
}
}
public java.util.List
getWhitelistedList() {
return java.util.Collections.unmodifiableList(whitelisted_);
}
public int getWhitelistedCount() {
return whitelisted_.size();
}
public String getWhitelisted(int index) {
return whitelisted_.get(index);
}
public Builder setWhitelisted(
int index, String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistedIsMutable();
whitelisted_.set(index, value);
onChanged();
return this;
}
public Builder addWhitelisted(String value) {
if (value == null) {
throw new NullPointerException();
}
ensureWhitelistedIsMutable();
whitelisted_.add(value);
onChanged();
return this;
}
public Builder addAllWhitelisted(
java.lang.Iterable values) {
ensureWhitelistedIsMutable();
super.addAll(values, whitelisted_);
onChanged();
return this;
}
public Builder clearWhitelisted() {
whitelisted_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
void addWhitelisted(com.google.protobuf.ByteString value) {
ensureWhitelistedIsMutable();
whitelisted_.add(value);
onChanged();
}
// optional string prior_feature_name = 5;
private java.lang.Object priorFeatureName_ = "";
public boolean hasPriorFeatureName() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public String getPriorFeatureName() {
java.lang.Object ref = priorFeatureName_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
priorFeatureName_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setPriorFeatureName(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000010;
priorFeatureName_ = value;
onChanged();
return this;
}
public Builder clearPriorFeatureName() {
bitField0_ = (bitField0_ & ~0x00000010);
priorFeatureName_ = getDefaultInstance().getPriorFeatureName();
onChanged();
return this;
}
void setPriorFeatureName(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000010;
priorFeatureName_ = value;
onChanged();
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.FeatureFlag)
}
static {
defaultInstance = new FeatureFlag(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.FeatureFlag)
}
public interface LimitDefinitionOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional string group = 1;
boolean hasGroup();
String getGroup();
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 2;
boolean hasPolicyName();
it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName();
// optional int32 limit = 3;
boolean hasLimit();
int getLimit();
// optional int32 burst = 4;
boolean hasBurst();
int getBurst();
// optional int64 account_id = 5;
boolean hasAccountId();
long getAccountId();
// optional int64 last_modified = 6;
boolean hasLastModified();
long getLastModified();
// optional bool returnable = 7;
boolean hasReturnable();
boolean getReturnable();
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 8 [default = L4_BEST_EFFORT];
boolean hasSafetyLevel();
it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel();
}
public static final class LimitDefinition extends
com.google.protobuf.GeneratedMessage
implements LimitDefinitionOrBuilder {
// Use LimitDefinition.newBuilder() to construct.
private LimitDefinition(Builder builder) {
super(builder);
}
private LimitDefinition(boolean noInit) {}
private static final LimitDefinition defaultInstance;
public static LimitDefinition getDefaultInstance() {
return defaultInstance;
}
public LimitDefinition getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinition_fieldAccessorTable;
}
public enum SafetyLevel
implements com.google.protobuf.ProtocolMessageEnum {
L4_BEST_EFFORT(0, 4),
L5_BOMBPROOF(1, 5),
;
public static final int L4_BEST_EFFORT_VALUE = 4;
public static final int L5_BOMBPROOF_VALUE = 5;
public final int getNumber() { return value; }
public static SafetyLevel valueOf(int value) {
switch (value) {
case 4: return L4_BEST_EFFORT;
case 5: return L5_BOMBPROOF;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static com.google.protobuf.Internal.EnumLiteMap
internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public SafetyLevel findValueByNumber(int number) {
return SafetyLevel.valueOf(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
return getDescriptor().getValues().get(index);
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.LimitDefinition.getDescriptor().getEnumTypes().get(0);
}
private static final SafetyLevel[] VALUES = {
L4_BEST_EFFORT, L5_BOMBPROOF,
};
public static SafetyLevel valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
return VALUES[desc.getIndex()];
}
private final int index;
private final int value;
private SafetyLevel(int index, int value) {
this.index = index;
this.value = value;
}
// @@protoc_insertion_point(enum_scope:it.ratelim.data.LimitDefinition.SafetyLevel)
}
private int bitField0_;
// optional string group = 1;
public static final int GROUP_FIELD_NUMBER = 1;
private java.lang.Object group_;
public boolean hasGroup() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getGroup() {
java.lang.Object ref = group_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
group_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getGroupBytes() {
java.lang.Object ref = group_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
group_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 2;
public static final int POLICY_NAME_FIELD_NUMBER = 2;
private it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames policyName_;
public boolean hasPolicyName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName() {
return policyName_;
}
// optional int32 limit = 3;
public static final int LIMIT_FIELD_NUMBER = 3;
private int limit_;
public boolean hasLimit() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getLimit() {
return limit_;
}
// optional int32 burst = 4;
public static final int BURST_FIELD_NUMBER = 4;
private int burst_;
public boolean hasBurst() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public int getBurst() {
return burst_;
}
// optional int64 account_id = 5;
public static final int ACCOUNT_ID_FIELD_NUMBER = 5;
private long accountId_;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public long getAccountId() {
return accountId_;
}
// optional int64 last_modified = 6;
public static final int LAST_MODIFIED_FIELD_NUMBER = 6;
private long lastModified_;
public boolean hasLastModified() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public long getLastModified() {
return lastModified_;
}
// optional bool returnable = 7;
public static final int RETURNABLE_FIELD_NUMBER = 7;
private boolean returnable_;
public boolean hasReturnable() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public boolean getReturnable() {
return returnable_;
}
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 8 [default = L4_BEST_EFFORT];
public static final int SAFETY_LEVEL_FIELD_NUMBER = 8;
private it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel safetyLevel_;
public boolean hasSafetyLevel() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel() {
return safetyLevel_;
}
private void initFields() {
group_ = "";
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
limit_ = 0;
burst_ = 0;
accountId_ = 0L;
lastModified_ = 0L;
returnable_ = false;
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeBytes(1, getGroupBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeEnum(2, policyName_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
output.writeInt32(3, limit_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
output.writeInt32(4, burst_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
output.writeInt64(5, accountId_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
output.writeInt64(6, lastModified_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
output.writeBool(7, returnable_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
output.writeEnum(8, safetyLevel_.getNumber());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(1, getGroupBytes());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, policyName_.getNumber());
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, limit_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, burst_);
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(5, accountId_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(6, lastModified_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(7, returnable_);
}
if (((bitField0_ & 0x00000080) == 0x00000080)) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(8, safetyLevel_.getNumber());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinition parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.LimitDefinition prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinition_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinition_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.LimitDefinition.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
group_ = "";
bitField0_ = (bitField0_ & ~0x00000001);
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
bitField0_ = (bitField0_ & ~0x00000002);
limit_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
burst_ = 0;
bitField0_ = (bitField0_ & ~0x00000008);
accountId_ = 0L;
bitField0_ = (bitField0_ & ~0x00000010);
lastModified_ = 0L;
bitField0_ = (bitField0_ & ~0x00000020);
returnable_ = false;
bitField0_ = (bitField0_ & ~0x00000040);
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
bitField0_ = (bitField0_ & ~0x00000080);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.LimitDefinition.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.LimitDefinition getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.LimitDefinition.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.LimitDefinition build() {
it.ratelim.data.RateLimitProtos.LimitDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.LimitDefinition buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.LimitDefinition result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.LimitDefinition buildPartial() {
it.ratelim.data.RateLimitProtos.LimitDefinition result = new it.ratelim.data.RateLimitProtos.LimitDefinition(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.group_ = group_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.policyName_ = policyName_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
to_bitField0_ |= 0x00000004;
}
result.limit_ = limit_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
to_bitField0_ |= 0x00000008;
}
result.burst_ = burst_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
to_bitField0_ |= 0x00000010;
}
result.accountId_ = accountId_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
to_bitField0_ |= 0x00000020;
}
result.lastModified_ = lastModified_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
to_bitField0_ |= 0x00000040;
}
result.returnable_ = returnable_;
if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
to_bitField0_ |= 0x00000080;
}
result.safetyLevel_ = safetyLevel_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.LimitDefinition) {
return mergeFrom((it.ratelim.data.RateLimitProtos.LimitDefinition)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.LimitDefinition other) {
if (other == it.ratelim.data.RateLimitProtos.LimitDefinition.getDefaultInstance()) return this;
if (other.hasGroup()) {
setGroup(other.getGroup());
}
if (other.hasPolicyName()) {
setPolicyName(other.getPolicyName());
}
if (other.hasLimit()) {
setLimit(other.getLimit());
}
if (other.hasBurst()) {
setBurst(other.getBurst());
}
if (other.hasAccountId()) {
setAccountId(other.getAccountId());
}
if (other.hasLastModified()) {
setLastModified(other.getLastModified());
}
if (other.hasReturnable()) {
setReturnable(other.getReturnable());
}
if (other.hasSafetyLevel()) {
setSafetyLevel(other.getSafetyLevel());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
bitField0_ |= 0x00000001;
group_ = input.readBytes();
break;
}
case 16: {
int rawValue = input.readEnum();
it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames value = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(2, rawValue);
} else {
bitField0_ |= 0x00000002;
policyName_ = value;
}
break;
}
case 24: {
bitField0_ |= 0x00000004;
limit_ = input.readInt32();
break;
}
case 32: {
bitField0_ |= 0x00000008;
burst_ = input.readInt32();
break;
}
case 40: {
bitField0_ |= 0x00000010;
accountId_ = input.readInt64();
break;
}
case 48: {
bitField0_ |= 0x00000020;
lastModified_ = input.readInt64();
break;
}
case 56: {
bitField0_ |= 0x00000040;
returnable_ = input.readBool();
break;
}
case 64: {
int rawValue = input.readEnum();
it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel value = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.valueOf(rawValue);
if (value == null) {
unknownFields.mergeVarintField(8, rawValue);
} else {
bitField0_ |= 0x00000080;
safetyLevel_ = value;
}
break;
}
}
}
}
private int bitField0_;
// optional string group = 1;
private java.lang.Object group_ = "";
public boolean hasGroup() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public String getGroup() {
java.lang.Object ref = group_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
group_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setGroup(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
group_ = value;
onChanged();
return this;
}
public Builder clearGroup() {
bitField0_ = (bitField0_ & ~0x00000001);
group_ = getDefaultInstance().getGroup();
onChanged();
return this;
}
void setGroup(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000001;
group_ = value;
onChanged();
}
// optional .it.ratelim.data.LimitResponse.LimitPolicyNames policy_name = 2;
private it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
public boolean hasPolicyName() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames getPolicyName() {
return policyName_;
}
public Builder setPolicyName(it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
policyName_ = value;
onChanged();
return this;
}
public Builder clearPolicyName() {
bitField0_ = (bitField0_ & ~0x00000002);
policyName_ = it.ratelim.data.RateLimitProtos.LimitResponse.LimitPolicyNames.SECONDLY;
onChanged();
return this;
}
// optional int32 limit = 3;
private int limit_ ;
public boolean hasLimit() {
return ((bitField0_ & 0x00000004) == 0x00000004);
}
public int getLimit() {
return limit_;
}
public Builder setLimit(int value) {
bitField0_ |= 0x00000004;
limit_ = value;
onChanged();
return this;
}
public Builder clearLimit() {
bitField0_ = (bitField0_ & ~0x00000004);
limit_ = 0;
onChanged();
return this;
}
// optional int32 burst = 4;
private int burst_ ;
public boolean hasBurst() {
return ((bitField0_ & 0x00000008) == 0x00000008);
}
public int getBurst() {
return burst_;
}
public Builder setBurst(int value) {
bitField0_ |= 0x00000008;
burst_ = value;
onChanged();
return this;
}
public Builder clearBurst() {
bitField0_ = (bitField0_ & ~0x00000008);
burst_ = 0;
onChanged();
return this;
}
// optional int64 account_id = 5;
private long accountId_ ;
public boolean hasAccountId() {
return ((bitField0_ & 0x00000010) == 0x00000010);
}
public long getAccountId() {
return accountId_;
}
public Builder setAccountId(long value) {
bitField0_ |= 0x00000010;
accountId_ = value;
onChanged();
return this;
}
public Builder clearAccountId() {
bitField0_ = (bitField0_ & ~0x00000010);
accountId_ = 0L;
onChanged();
return this;
}
// optional int64 last_modified = 6;
private long lastModified_ ;
public boolean hasLastModified() {
return ((bitField0_ & 0x00000020) == 0x00000020);
}
public long getLastModified() {
return lastModified_;
}
public Builder setLastModified(long value) {
bitField0_ |= 0x00000020;
lastModified_ = value;
onChanged();
return this;
}
public Builder clearLastModified() {
bitField0_ = (bitField0_ & ~0x00000020);
lastModified_ = 0L;
onChanged();
return this;
}
// optional bool returnable = 7;
private boolean returnable_ ;
public boolean hasReturnable() {
return ((bitField0_ & 0x00000040) == 0x00000040);
}
public boolean getReturnable() {
return returnable_;
}
public Builder setReturnable(boolean value) {
bitField0_ |= 0x00000040;
returnable_ = value;
onChanged();
return this;
}
public Builder clearReturnable() {
bitField0_ = (bitField0_ & ~0x00000040);
returnable_ = false;
onChanged();
return this;
}
// optional .it.ratelim.data.LimitDefinition.SafetyLevel safety_level = 8 [default = L4_BEST_EFFORT];
private it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
public boolean hasSafetyLevel() {
return ((bitField0_ & 0x00000080) == 0x00000080);
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel getSafetyLevel() {
return safetyLevel_;
}
public Builder setSafetyLevel(it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000080;
safetyLevel_ = value;
onChanged();
return this;
}
public Builder clearSafetyLevel() {
bitField0_ = (bitField0_ & ~0x00000080);
safetyLevel_ = it.ratelim.data.RateLimitProtos.LimitDefinition.SafetyLevel.L4_BEST_EFFORT;
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.LimitDefinition)
}
static {
defaultInstance = new LimitDefinition(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.LimitDefinition)
}
public interface LimitDefinitionsOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated .it.ratelim.data.LimitDefinition definitions = 1;
java.util.List
getDefinitionsList();
it.ratelim.data.RateLimitProtos.LimitDefinition getDefinitions(int index);
int getDefinitionsCount();
java.util.List extends it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder>
getDefinitionsOrBuilderList();
it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder getDefinitionsOrBuilder(
int index);
}
public static final class LimitDefinitions extends
com.google.protobuf.GeneratedMessage
implements LimitDefinitionsOrBuilder {
// Use LimitDefinitions.newBuilder() to construct.
private LimitDefinitions(Builder builder) {
super(builder);
}
private LimitDefinitions(boolean noInit) {}
private static final LimitDefinitions defaultInstance;
public static LimitDefinitions getDefaultInstance() {
return defaultInstance;
}
public LimitDefinitions getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinitions_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinitions_fieldAccessorTable;
}
// repeated .it.ratelim.data.LimitDefinition definitions = 1;
public static final int DEFINITIONS_FIELD_NUMBER = 1;
private java.util.List definitions_;
public java.util.List getDefinitionsList() {
return definitions_;
}
public java.util.List extends it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder>
getDefinitionsOrBuilderList() {
return definitions_;
}
public int getDefinitionsCount() {
return definitions_.size();
}
public it.ratelim.data.RateLimitProtos.LimitDefinition getDefinitions(int index) {
return definitions_.get(index);
}
public it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder getDefinitionsOrBuilder(
int index) {
return definitions_.get(index);
}
private void initFields() {
definitions_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < definitions_.size(); i++) {
output.writeMessage(1, definitions_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < definitions_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, definitions_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.LimitDefinitions parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.LimitDefinitions prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.LimitDefinitionsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinitions_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_LimitDefinitions_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.LimitDefinitions.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getDefinitionsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (definitionsBuilder_ == null) {
definitions_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
definitionsBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.LimitDefinitions.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.LimitDefinitions getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.LimitDefinitions.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.LimitDefinitions build() {
it.ratelim.data.RateLimitProtos.LimitDefinitions result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.LimitDefinitions buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.LimitDefinitions result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.LimitDefinitions buildPartial() {
it.ratelim.data.RateLimitProtos.LimitDefinitions result = new it.ratelim.data.RateLimitProtos.LimitDefinitions(this);
int from_bitField0_ = bitField0_;
if (definitionsBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
definitions_ = java.util.Collections.unmodifiableList(definitions_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.definitions_ = definitions_;
} else {
result.definitions_ = definitionsBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.LimitDefinitions) {
return mergeFrom((it.ratelim.data.RateLimitProtos.LimitDefinitions)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.LimitDefinitions other) {
if (other == it.ratelim.data.RateLimitProtos.LimitDefinitions.getDefaultInstance()) return this;
if (definitionsBuilder_ == null) {
if (!other.definitions_.isEmpty()) {
if (definitions_.isEmpty()) {
definitions_ = other.definitions_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDefinitionsIsMutable();
definitions_.addAll(other.definitions_);
}
onChanged();
}
} else {
if (!other.definitions_.isEmpty()) {
if (definitionsBuilder_.isEmpty()) {
definitionsBuilder_.dispose();
definitionsBuilder_ = null;
definitions_ = other.definitions_;
bitField0_ = (bitField0_ & ~0x00000001);
definitionsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getDefinitionsFieldBuilder() : null;
} else {
definitionsBuilder_.addAllMessages(other.definitions_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
it.ratelim.data.RateLimitProtos.LimitDefinition.Builder subBuilder = it.ratelim.data.RateLimitProtos.LimitDefinition.newBuilder();
input.readMessage(subBuilder, extensionRegistry);
addDefinitions(subBuilder.buildPartial());
break;
}
}
}
}
private int bitField0_;
// repeated .it.ratelim.data.LimitDefinition definitions = 1;
private java.util.List definitions_ =
java.util.Collections.emptyList();
private void ensureDefinitionsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
definitions_ = new java.util.ArrayList(definitions_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.LimitDefinition, it.ratelim.data.RateLimitProtos.LimitDefinition.Builder, it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder> definitionsBuilder_;
public java.util.List getDefinitionsList() {
if (definitionsBuilder_ == null) {
return java.util.Collections.unmodifiableList(definitions_);
} else {
return definitionsBuilder_.getMessageList();
}
}
public int getDefinitionsCount() {
if (definitionsBuilder_ == null) {
return definitions_.size();
} else {
return definitionsBuilder_.getCount();
}
}
public it.ratelim.data.RateLimitProtos.LimitDefinition getDefinitions(int index) {
if (definitionsBuilder_ == null) {
return definitions_.get(index);
} else {
return definitionsBuilder_.getMessage(index);
}
}
public Builder setDefinitions(
int index, it.ratelim.data.RateLimitProtos.LimitDefinition value) {
if (definitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDefinitionsIsMutable();
definitions_.set(index, value);
onChanged();
} else {
definitionsBuilder_.setMessage(index, value);
}
return this;
}
public Builder setDefinitions(
int index, it.ratelim.data.RateLimitProtos.LimitDefinition.Builder builderForValue) {
if (definitionsBuilder_ == null) {
ensureDefinitionsIsMutable();
definitions_.set(index, builderForValue.build());
onChanged();
} else {
definitionsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
public Builder addDefinitions(it.ratelim.data.RateLimitProtos.LimitDefinition value) {
if (definitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDefinitionsIsMutable();
definitions_.add(value);
onChanged();
} else {
definitionsBuilder_.addMessage(value);
}
return this;
}
public Builder addDefinitions(
int index, it.ratelim.data.RateLimitProtos.LimitDefinition value) {
if (definitionsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDefinitionsIsMutable();
definitions_.add(index, value);
onChanged();
} else {
definitionsBuilder_.addMessage(index, value);
}
return this;
}
public Builder addDefinitions(
it.ratelim.data.RateLimitProtos.LimitDefinition.Builder builderForValue) {
if (definitionsBuilder_ == null) {
ensureDefinitionsIsMutable();
definitions_.add(builderForValue.build());
onChanged();
} else {
definitionsBuilder_.addMessage(builderForValue.build());
}
return this;
}
public Builder addDefinitions(
int index, it.ratelim.data.RateLimitProtos.LimitDefinition.Builder builderForValue) {
if (definitionsBuilder_ == null) {
ensureDefinitionsIsMutable();
definitions_.add(index, builderForValue.build());
onChanged();
} else {
definitionsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
public Builder addAllDefinitions(
java.lang.Iterable extends it.ratelim.data.RateLimitProtos.LimitDefinition> values) {
if (definitionsBuilder_ == null) {
ensureDefinitionsIsMutable();
super.addAll(values, definitions_);
onChanged();
} else {
definitionsBuilder_.addAllMessages(values);
}
return this;
}
public Builder clearDefinitions() {
if (definitionsBuilder_ == null) {
definitions_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
definitionsBuilder_.clear();
}
return this;
}
public Builder removeDefinitions(int index) {
if (definitionsBuilder_ == null) {
ensureDefinitionsIsMutable();
definitions_.remove(index);
onChanged();
} else {
definitionsBuilder_.remove(index);
}
return this;
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.Builder getDefinitionsBuilder(
int index) {
return getDefinitionsFieldBuilder().getBuilder(index);
}
public it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder getDefinitionsOrBuilder(
int index) {
if (definitionsBuilder_ == null) {
return definitions_.get(index); } else {
return definitionsBuilder_.getMessageOrBuilder(index);
}
}
public java.util.List extends it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder>
getDefinitionsOrBuilderList() {
if (definitionsBuilder_ != null) {
return definitionsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(definitions_);
}
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.Builder addDefinitionsBuilder() {
return getDefinitionsFieldBuilder().addBuilder(
it.ratelim.data.RateLimitProtos.LimitDefinition.getDefaultInstance());
}
public it.ratelim.data.RateLimitProtos.LimitDefinition.Builder addDefinitionsBuilder(
int index) {
return getDefinitionsFieldBuilder().addBuilder(
index, it.ratelim.data.RateLimitProtos.LimitDefinition.getDefaultInstance());
}
public java.util.List
getDefinitionsBuilderList() {
return getDefinitionsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.LimitDefinition, it.ratelim.data.RateLimitProtos.LimitDefinition.Builder, it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder>
getDefinitionsFieldBuilder() {
if (definitionsBuilder_ == null) {
definitionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.LimitDefinition, it.ratelim.data.RateLimitProtos.LimitDefinition.Builder, it.ratelim.data.RateLimitProtos.LimitDefinitionOrBuilder>(
definitions_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
definitions_ = null;
}
return definitionsBuilder_;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.LimitDefinitions)
}
static {
defaultInstance = new LimitDefinitions(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.LimitDefinitions)
}
public interface FeatureFlagsOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// repeated .it.ratelim.data.FeatureFlag flags = 1;
java.util.List
getFlagsList();
it.ratelim.data.RateLimitProtos.FeatureFlag getFlags(int index);
int getFlagsCount();
java.util.List extends it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder>
getFlagsOrBuilderList();
it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder getFlagsOrBuilder(
int index);
}
public static final class FeatureFlags extends
com.google.protobuf.GeneratedMessage
implements FeatureFlagsOrBuilder {
// Use FeatureFlags.newBuilder() to construct.
private FeatureFlags(Builder builder) {
super(builder);
}
private FeatureFlags(boolean noInit) {}
private static final FeatureFlags defaultInstance;
public static FeatureFlags getDefaultInstance() {
return defaultInstance;
}
public FeatureFlags getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlags_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlags_fieldAccessorTable;
}
// repeated .it.ratelim.data.FeatureFlag flags = 1;
public static final int FLAGS_FIELD_NUMBER = 1;
private java.util.List flags_;
public java.util.List getFlagsList() {
return flags_;
}
public java.util.List extends it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder>
getFlagsOrBuilderList() {
return flags_;
}
public int getFlagsCount() {
return flags_.size();
}
public it.ratelim.data.RateLimitProtos.FeatureFlag getFlags(int index) {
return flags_.get(index);
}
public it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder getFlagsOrBuilder(
int index) {
return flags_.get(index);
}
private void initFields() {
flags_ = java.util.Collections.emptyList();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
for (int i = 0; i < flags_.size(); i++) {
output.writeMessage(1, flags_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < flags_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, flags_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.FeatureFlags parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.FeatureFlags prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.FeatureFlagsOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlags_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_FeatureFlags_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.FeatureFlags.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getFlagsFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (flagsBuilder_ == null) {
flags_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
flagsBuilder_.clear();
}
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.FeatureFlags.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.FeatureFlags getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.FeatureFlags.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.FeatureFlags build() {
it.ratelim.data.RateLimitProtos.FeatureFlags result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.FeatureFlags buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.FeatureFlags result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.FeatureFlags buildPartial() {
it.ratelim.data.RateLimitProtos.FeatureFlags result = new it.ratelim.data.RateLimitProtos.FeatureFlags(this);
int from_bitField0_ = bitField0_;
if (flagsBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
flags_ = java.util.Collections.unmodifiableList(flags_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.flags_ = flags_;
} else {
result.flags_ = flagsBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.FeatureFlags) {
return mergeFrom((it.ratelim.data.RateLimitProtos.FeatureFlags)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.FeatureFlags other) {
if (other == it.ratelim.data.RateLimitProtos.FeatureFlags.getDefaultInstance()) return this;
if (flagsBuilder_ == null) {
if (!other.flags_.isEmpty()) {
if (flags_.isEmpty()) {
flags_ = other.flags_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureFlagsIsMutable();
flags_.addAll(other.flags_);
}
onChanged();
}
} else {
if (!other.flags_.isEmpty()) {
if (flagsBuilder_.isEmpty()) {
flagsBuilder_.dispose();
flagsBuilder_ = null;
flags_ = other.flags_;
bitField0_ = (bitField0_ & ~0x00000001);
flagsBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getFlagsFieldBuilder() : null;
} else {
flagsBuilder_.addAllMessages(other.flags_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
it.ratelim.data.RateLimitProtos.FeatureFlag.Builder subBuilder = it.ratelim.data.RateLimitProtos.FeatureFlag.newBuilder();
input.readMessage(subBuilder, extensionRegistry);
addFlags(subBuilder.buildPartial());
break;
}
}
}
}
private int bitField0_;
// repeated .it.ratelim.data.FeatureFlag flags = 1;
private java.util.List flags_ =
java.util.Collections.emptyList();
private void ensureFlagsIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
flags_ = new java.util.ArrayList(flags_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.FeatureFlag, it.ratelim.data.RateLimitProtos.FeatureFlag.Builder, it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder> flagsBuilder_;
public java.util.List getFlagsList() {
if (flagsBuilder_ == null) {
return java.util.Collections.unmodifiableList(flags_);
} else {
return flagsBuilder_.getMessageList();
}
}
public int getFlagsCount() {
if (flagsBuilder_ == null) {
return flags_.size();
} else {
return flagsBuilder_.getCount();
}
}
public it.ratelim.data.RateLimitProtos.FeatureFlag getFlags(int index) {
if (flagsBuilder_ == null) {
return flags_.get(index);
} else {
return flagsBuilder_.getMessage(index);
}
}
public Builder setFlags(
int index, it.ratelim.data.RateLimitProtos.FeatureFlag value) {
if (flagsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFlagsIsMutable();
flags_.set(index, value);
onChanged();
} else {
flagsBuilder_.setMessage(index, value);
}
return this;
}
public Builder setFlags(
int index, it.ratelim.data.RateLimitProtos.FeatureFlag.Builder builderForValue) {
if (flagsBuilder_ == null) {
ensureFlagsIsMutable();
flags_.set(index, builderForValue.build());
onChanged();
} else {
flagsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
public Builder addFlags(it.ratelim.data.RateLimitProtos.FeatureFlag value) {
if (flagsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFlagsIsMutable();
flags_.add(value);
onChanged();
} else {
flagsBuilder_.addMessage(value);
}
return this;
}
public Builder addFlags(
int index, it.ratelim.data.RateLimitProtos.FeatureFlag value) {
if (flagsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFlagsIsMutable();
flags_.add(index, value);
onChanged();
} else {
flagsBuilder_.addMessage(index, value);
}
return this;
}
public Builder addFlags(
it.ratelim.data.RateLimitProtos.FeatureFlag.Builder builderForValue) {
if (flagsBuilder_ == null) {
ensureFlagsIsMutable();
flags_.add(builderForValue.build());
onChanged();
} else {
flagsBuilder_.addMessage(builderForValue.build());
}
return this;
}
public Builder addFlags(
int index, it.ratelim.data.RateLimitProtos.FeatureFlag.Builder builderForValue) {
if (flagsBuilder_ == null) {
ensureFlagsIsMutable();
flags_.add(index, builderForValue.build());
onChanged();
} else {
flagsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
public Builder addAllFlags(
java.lang.Iterable extends it.ratelim.data.RateLimitProtos.FeatureFlag> values) {
if (flagsBuilder_ == null) {
ensureFlagsIsMutable();
super.addAll(values, flags_);
onChanged();
} else {
flagsBuilder_.addAllMessages(values);
}
return this;
}
public Builder clearFlags() {
if (flagsBuilder_ == null) {
flags_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
flagsBuilder_.clear();
}
return this;
}
public Builder removeFlags(int index) {
if (flagsBuilder_ == null) {
ensureFlagsIsMutable();
flags_.remove(index);
onChanged();
} else {
flagsBuilder_.remove(index);
}
return this;
}
public it.ratelim.data.RateLimitProtos.FeatureFlag.Builder getFlagsBuilder(
int index) {
return getFlagsFieldBuilder().getBuilder(index);
}
public it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder getFlagsOrBuilder(
int index) {
if (flagsBuilder_ == null) {
return flags_.get(index); } else {
return flagsBuilder_.getMessageOrBuilder(index);
}
}
public java.util.List extends it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder>
getFlagsOrBuilderList() {
if (flagsBuilder_ != null) {
return flagsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(flags_);
}
}
public it.ratelim.data.RateLimitProtos.FeatureFlag.Builder addFlagsBuilder() {
return getFlagsFieldBuilder().addBuilder(
it.ratelim.data.RateLimitProtos.FeatureFlag.getDefaultInstance());
}
public it.ratelim.data.RateLimitProtos.FeatureFlag.Builder addFlagsBuilder(
int index) {
return getFlagsFieldBuilder().addBuilder(
index, it.ratelim.data.RateLimitProtos.FeatureFlag.getDefaultInstance());
}
public java.util.List
getFlagsBuilderList() {
return getFlagsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.FeatureFlag, it.ratelim.data.RateLimitProtos.FeatureFlag.Builder, it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder>
getFlagsFieldBuilder() {
if (flagsBuilder_ == null) {
flagsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
it.ratelim.data.RateLimitProtos.FeatureFlag, it.ratelim.data.RateLimitProtos.FeatureFlag.Builder, it.ratelim.data.RateLimitProtos.FeatureFlagOrBuilder>(
flags_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
flags_ = null;
}
return flagsBuilder_;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.FeatureFlags)
}
static {
defaultInstance = new FeatureFlags(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.FeatureFlags)
}
public interface BucketWriteOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional .it.ratelim.data.TokenBucket tokenBucket = 1;
boolean hasTokenBucket();
it.ratelim.data.RateLimitProtos.TokenBucket getTokenBucket();
it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder getTokenBucketOrBuilder();
// optional string bucket = 2;
boolean hasBucket();
String getBucket();
}
public static final class BucketWrite extends
com.google.protobuf.GeneratedMessage
implements BucketWriteOrBuilder {
// Use BucketWrite.newBuilder() to construct.
private BucketWrite(Builder builder) {
super(builder);
}
private BucketWrite(boolean noInit) {}
private static final BucketWrite defaultInstance;
public static BucketWrite getDefaultInstance() {
return defaultInstance;
}
public BucketWrite getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_BucketWrite_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_BucketWrite_fieldAccessorTable;
}
private int bitField0_;
// optional .it.ratelim.data.TokenBucket tokenBucket = 1;
public static final int TOKENBUCKET_FIELD_NUMBER = 1;
private it.ratelim.data.RateLimitProtos.TokenBucket tokenBucket_;
public boolean hasTokenBucket() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public it.ratelim.data.RateLimitProtos.TokenBucket getTokenBucket() {
return tokenBucket_;
}
public it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder getTokenBucketOrBuilder() {
return tokenBucket_;
}
// optional string bucket = 2;
public static final int BUCKET_FIELD_NUMBER = 2;
private java.lang.Object bucket_;
public boolean hasBucket() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public String getBucket() {
java.lang.Object ref = bucket_;
if (ref instanceof String) {
return (String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
String s = bs.toStringUtf8();
if (com.google.protobuf.Internal.isValidUtf8(bs)) {
bucket_ = s;
}
return s;
}
}
private com.google.protobuf.ByteString getBucketBytes() {
java.lang.Object ref = bucket_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((String) ref);
bucket_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private void initFields() {
tokenBucket_ = it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance();
bucket_ = "";
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeMessage(1, tokenBucket_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeBytes(2, getBucketBytes());
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, tokenBucket_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getBucketBytes());
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.BucketWrite parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.BucketWrite prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.BucketWriteOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_BucketWrite_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_BucketWrite_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.BucketWrite.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getTokenBucketFieldBuilder();
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
if (tokenBucketBuilder_ == null) {
tokenBucket_ = it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance();
} else {
tokenBucketBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
bucket_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.BucketWrite.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.BucketWrite getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.BucketWrite.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.BucketWrite build() {
it.ratelim.data.RateLimitProtos.BucketWrite result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.BucketWrite buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.BucketWrite result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.BucketWrite buildPartial() {
it.ratelim.data.RateLimitProtos.BucketWrite result = new it.ratelim.data.RateLimitProtos.BucketWrite(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
if (tokenBucketBuilder_ == null) {
result.tokenBucket_ = tokenBucket_;
} else {
result.tokenBucket_ = tokenBucketBuilder_.build();
}
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.bucket_ = bucket_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.BucketWrite) {
return mergeFrom((it.ratelim.data.RateLimitProtos.BucketWrite)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.BucketWrite other) {
if (other == it.ratelim.data.RateLimitProtos.BucketWrite.getDefaultInstance()) return this;
if (other.hasTokenBucket()) {
mergeTokenBucket(other.getTokenBucket());
}
if (other.hasBucket()) {
setBucket(other.getBucket());
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 10: {
it.ratelim.data.RateLimitProtos.TokenBucket.Builder subBuilder = it.ratelim.data.RateLimitProtos.TokenBucket.newBuilder();
if (hasTokenBucket()) {
subBuilder.mergeFrom(getTokenBucket());
}
input.readMessage(subBuilder, extensionRegistry);
setTokenBucket(subBuilder.buildPartial());
break;
}
case 18: {
bitField0_ |= 0x00000002;
bucket_ = input.readBytes();
break;
}
}
}
}
private int bitField0_;
// optional .it.ratelim.data.TokenBucket tokenBucket = 1;
private it.ratelim.data.RateLimitProtos.TokenBucket tokenBucket_ = it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance();
private com.google.protobuf.SingleFieldBuilder<
it.ratelim.data.RateLimitProtos.TokenBucket, it.ratelim.data.RateLimitProtos.TokenBucket.Builder, it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder> tokenBucketBuilder_;
public boolean hasTokenBucket() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public it.ratelim.data.RateLimitProtos.TokenBucket getTokenBucket() {
if (tokenBucketBuilder_ == null) {
return tokenBucket_;
} else {
return tokenBucketBuilder_.getMessage();
}
}
public Builder setTokenBucket(it.ratelim.data.RateLimitProtos.TokenBucket value) {
if (tokenBucketBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
tokenBucket_ = value;
onChanged();
} else {
tokenBucketBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
return this;
}
public Builder setTokenBucket(
it.ratelim.data.RateLimitProtos.TokenBucket.Builder builderForValue) {
if (tokenBucketBuilder_ == null) {
tokenBucket_ = builderForValue.build();
onChanged();
} else {
tokenBucketBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
return this;
}
public Builder mergeTokenBucket(it.ratelim.data.RateLimitProtos.TokenBucket value) {
if (tokenBucketBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001) &&
tokenBucket_ != it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance()) {
tokenBucket_ =
it.ratelim.data.RateLimitProtos.TokenBucket.newBuilder(tokenBucket_).mergeFrom(value).buildPartial();
} else {
tokenBucket_ = value;
}
onChanged();
} else {
tokenBucketBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000001;
return this;
}
public Builder clearTokenBucket() {
if (tokenBucketBuilder_ == null) {
tokenBucket_ = it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance();
onChanged();
} else {
tokenBucketBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
public it.ratelim.data.RateLimitProtos.TokenBucket.Builder getTokenBucketBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getTokenBucketFieldBuilder().getBuilder();
}
public it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder getTokenBucketOrBuilder() {
if (tokenBucketBuilder_ != null) {
return tokenBucketBuilder_.getMessageOrBuilder();
} else {
return tokenBucket_;
}
}
private com.google.protobuf.SingleFieldBuilder<
it.ratelim.data.RateLimitProtos.TokenBucket, it.ratelim.data.RateLimitProtos.TokenBucket.Builder, it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder>
getTokenBucketFieldBuilder() {
if (tokenBucketBuilder_ == null) {
tokenBucketBuilder_ = new com.google.protobuf.SingleFieldBuilder<
it.ratelim.data.RateLimitProtos.TokenBucket, it.ratelim.data.RateLimitProtos.TokenBucket.Builder, it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder>(
tokenBucket_,
getParentForChildren(),
isClean());
tokenBucket_ = null;
}
return tokenBucketBuilder_;
}
// optional string bucket = 2;
private java.lang.Object bucket_ = "";
public boolean hasBucket() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public String getBucket() {
java.lang.Object ref = bucket_;
if (!(ref instanceof String)) {
String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();
bucket_ = s;
return s;
} else {
return (String) ref;
}
}
public Builder setBucket(String value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
bucket_ = value;
onChanged();
return this;
}
public Builder clearBucket() {
bitField0_ = (bitField0_ & ~0x00000002);
bucket_ = getDefaultInstance().getBucket();
onChanged();
return this;
}
void setBucket(com.google.protobuf.ByteString value) {
bitField0_ |= 0x00000002;
bucket_ = value;
onChanged();
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.BucketWrite)
}
static {
defaultInstance = new BucketWrite(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.BucketWrite)
}
public interface TokenBucketOrBuilder
extends com.google.protobuf.MessageOrBuilder {
// optional int64 current_value = 1;
boolean hasCurrentValue();
long getCurrentValue();
// optional int64 time_key = 2;
boolean hasTimeKey();
long getTimeKey();
// repeated int64 expiries = 3;
java.util.List getExpiriesList();
int getExpiriesCount();
long getExpiries(int index);
}
public static final class TokenBucket extends
com.google.protobuf.GeneratedMessage
implements TokenBucketOrBuilder {
// Use TokenBucket.newBuilder() to construct.
private TokenBucket(Builder builder) {
super(builder);
}
private TokenBucket(boolean noInit) {}
private static final TokenBucket defaultInstance;
public static TokenBucket getDefaultInstance() {
return defaultInstance;
}
public TokenBucket getDefaultInstanceForType() {
return defaultInstance;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_TokenBucket_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_TokenBucket_fieldAccessorTable;
}
private int bitField0_;
// optional int64 current_value = 1;
public static final int CURRENT_VALUE_FIELD_NUMBER = 1;
private long currentValue_;
public boolean hasCurrentValue() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getCurrentValue() {
return currentValue_;
}
// optional int64 time_key = 2;
public static final int TIME_KEY_FIELD_NUMBER = 2;
private long timeKey_;
public boolean hasTimeKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public long getTimeKey() {
return timeKey_;
}
// repeated int64 expiries = 3;
public static final int EXPIRIES_FIELD_NUMBER = 3;
private java.util.List expiries_;
public java.util.List
getExpiriesList() {
return expiries_;
}
public int getExpiriesCount() {
return expiries_.size();
}
public long getExpiries(int index) {
return expiries_.get(index);
}
private void initFields() {
currentValue_ = 0L;
timeKey_ = 0L;
expiries_ = java.util.Collections.emptyList();;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
output.writeInt64(1, currentValue_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
output.writeInt64(2, timeKey_);
}
for (int i = 0; i < expiries_.size(); i++) {
output.writeInt64(3, expiries_.get(i));
}
getUnknownFields().writeTo(output);
}
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(1, currentValue_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(2, timeKey_);
}
{
int dataSize = 0;
for (int i = 0; i < expiries_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeInt64SizeNoTag(expiries_.get(i));
}
size += dataSize;
size += 1 * getExpiriesList().size();
}
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
protected java.lang.Object writeReplace()
throws java.io.ObjectStreamException {
return super.writeReplace();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return newBuilder().mergeFrom(data, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(java.io.InputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Builder builder = newBuilder();
if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
return builder.buildParsed();
} else {
return null;
}
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return newBuilder().mergeFrom(input).buildParsed();
}
public static it.ratelim.data.RateLimitProtos.TokenBucket parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return newBuilder().mergeFrom(input, extensionRegistry)
.buildParsed();
}
public static Builder newBuilder() { return Builder.create(); }
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(it.ratelim.data.RateLimitProtos.TokenBucket prototype) {
return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder
implements it.ratelim.data.RateLimitProtos.TokenBucketOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_TokenBucket_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return it.ratelim.data.RateLimitProtos.internal_static_it_ratelim_data_TokenBucket_fieldAccessorTable;
}
// Construct using it.ratelim.data.RateLimitProtos.TokenBucket.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
private static Builder create() {
return new Builder();
}
public Builder clear() {
super.clear();
currentValue_ = 0L;
bitField0_ = (bitField0_ & ~0x00000001);
timeKey_ = 0L;
bitField0_ = (bitField0_ & ~0x00000002);
expiries_ = java.util.Collections.emptyList();;
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
public Builder clone() {
return create().mergeFrom(buildPartial());
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return it.ratelim.data.RateLimitProtos.TokenBucket.getDescriptor();
}
public it.ratelim.data.RateLimitProtos.TokenBucket getDefaultInstanceForType() {
return it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance();
}
public it.ratelim.data.RateLimitProtos.TokenBucket build() {
it.ratelim.data.RateLimitProtos.TokenBucket result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
private it.ratelim.data.RateLimitProtos.TokenBucket buildParsed()
throws com.google.protobuf.InvalidProtocolBufferException {
it.ratelim.data.RateLimitProtos.TokenBucket result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(
result).asInvalidProtocolBufferException();
}
return result;
}
public it.ratelim.data.RateLimitProtos.TokenBucket buildPartial() {
it.ratelim.data.RateLimitProtos.TokenBucket result = new it.ratelim.data.RateLimitProtos.TokenBucket(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
to_bitField0_ |= 0x00000001;
}
result.currentValue_ = currentValue_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
to_bitField0_ |= 0x00000002;
}
result.timeKey_ = timeKey_;
if (((bitField0_ & 0x00000004) == 0x00000004)) {
expiries_ = java.util.Collections.unmodifiableList(expiries_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.expiries_ = expiries_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof it.ratelim.data.RateLimitProtos.TokenBucket) {
return mergeFrom((it.ratelim.data.RateLimitProtos.TokenBucket)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(it.ratelim.data.RateLimitProtos.TokenBucket other) {
if (other == it.ratelim.data.RateLimitProtos.TokenBucket.getDefaultInstance()) return this;
if (other.hasCurrentValue()) {
setCurrentValue(other.getCurrentValue());
}
if (other.hasTimeKey()) {
setTimeKey(other.getTimeKey());
}
if (!other.expiries_.isEmpty()) {
if (expiries_.isEmpty()) {
expiries_ = other.expiries_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureExpiriesIsMutable();
expiries_.addAll(other.expiries_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
onChanged();
return this;
}
break;
}
case 8: {
bitField0_ |= 0x00000001;
currentValue_ = input.readInt64();
break;
}
case 16: {
bitField0_ |= 0x00000002;
timeKey_ = input.readInt64();
break;
}
case 24: {
ensureExpiriesIsMutable();
expiries_.add(input.readInt64());
break;
}
case 26: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
while (input.getBytesUntilLimit() > 0) {
addExpiries(input.readInt64());
}
input.popLimit(limit);
break;
}
}
}
}
private int bitField0_;
// optional int64 current_value = 1;
private long currentValue_ ;
public boolean hasCurrentValue() {
return ((bitField0_ & 0x00000001) == 0x00000001);
}
public long getCurrentValue() {
return currentValue_;
}
public Builder setCurrentValue(long value) {
bitField0_ |= 0x00000001;
currentValue_ = value;
onChanged();
return this;
}
public Builder clearCurrentValue() {
bitField0_ = (bitField0_ & ~0x00000001);
currentValue_ = 0L;
onChanged();
return this;
}
// optional int64 time_key = 2;
private long timeKey_ ;
public boolean hasTimeKey() {
return ((bitField0_ & 0x00000002) == 0x00000002);
}
public long getTimeKey() {
return timeKey_;
}
public Builder setTimeKey(long value) {
bitField0_ |= 0x00000002;
timeKey_ = value;
onChanged();
return this;
}
public Builder clearTimeKey() {
bitField0_ = (bitField0_ & ~0x00000002);
timeKey_ = 0L;
onChanged();
return this;
}
// repeated int64 expiries = 3;
private java.util.List expiries_ = java.util.Collections.emptyList();;
private void ensureExpiriesIsMutable() {
if (!((bitField0_ & 0x00000004) == 0x00000004)) {
expiries_ = new java.util.ArrayList(expiries_);
bitField0_ |= 0x00000004;
}
}
public java.util.List
getExpiriesList() {
return java.util.Collections.unmodifiableList(expiries_);
}
public int getExpiriesCount() {
return expiries_.size();
}
public long getExpiries(int index) {
return expiries_.get(index);
}
public Builder setExpiries(
int index, long value) {
ensureExpiriesIsMutable();
expiries_.set(index, value);
onChanged();
return this;
}
public Builder addExpiries(long value) {
ensureExpiriesIsMutable();
expiries_.add(value);
onChanged();
return this;
}
public Builder addAllExpiries(
java.lang.Iterable extends java.lang.Long> values) {
ensureExpiriesIsMutable();
super.addAll(values, expiries_);
onChanged();
return this;
}
public Builder clearExpiries() {
expiries_ = java.util.Collections.emptyList();;
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:it.ratelim.data.TokenBucket)
}
static {
defaultInstance = new TokenBucket(true);
defaultInstance.initFields();
}
// @@protoc_insertion_point(class_scope:it.ratelim.data.TokenBucket)
}
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_LimitResponse_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_LimitResponse_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_LimitRequest_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_LimitRequest_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_FeatureFlag_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_FeatureFlag_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_LimitDefinition_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_LimitDefinition_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_LimitDefinitions_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_LimitDefinitions_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_FeatureFlags_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_FeatureFlags_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_BucketWrite_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_BucketWrite_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_it_ratelim_data_TokenBucket_descriptor;
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_it_ratelim_data_TokenBucket_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\017ratelimit.proto\022\017it.ratelim.data\"\352\003\n\rL" +
"imitResponse\022\024\n\006passed\030\001 \001(\010:\004true\022\022\n\nex" +
"pires_at\030\002 \001(\003\022\026\n\016enforced_group\030\003 \001(\t\022\026" +
"\n\016current_bucket\030\004 \001(\003\022\024\n\014policy_group\030\005" +
" \001(\t\022D\n\013policy_name\030\006 \001(\0162/.it.ratelim.d" +
"ata.LimitResponse.LimitPolicyNames\022\024\n\014po" +
"licy_limit\030\007 \001(\005\022\021\n\006amount\030\010 \001(\003:\0011\022\026\n\016l" +
"imit_reset_at\030\t \001(\003\022B\n\014safety_level\030\n \001(" +
"\0162,.it.ratelim.data.LimitDefinition.Safe" +
"tyLevel\"\235\001\n\020LimitPolicyNames\022\014\n\010SECONDLY",
"\020\001\022\014\n\010MINUTELY\020\002\022\024\n\020MINUTELY_ROLLING\020\003\022\n" +
"\n\006HOURLY\020\004\022\022\n\016HOURLY_ROLLING\020\005\022\t\n\005DAILY\020" +
"\006\022\021\n\rDAILY_ROLLING\020\007\022\013\n\007MONTHLY\020\010\022\014\n\010INF" +
"INITE\020\t\"\243\002\n\014LimitRequest\022\022\n\naccount_id\030\001" +
" \001(\003\022\025\n\rpartition_key\030\002 \001(\014\022\031\n\016acquire_a" +
"mount\030\003 \001(\005:\0011\022\016\n\006groups\030\004 \003(\t\022L\n\016limit_" +
"combiner\030\005 \001(\0162+.it.ratelim.data.LimitRe" +
"quest.LimitCombiner:\007MAXIMUM\022\035\n\017persist_" +
"request\030\007 \001(\010:\004true\022%\n\026allow_partial_res" +
"ponse\030\010 \001(\010:\005false\")\n\rLimitCombiner\022\013\n\007M",
"INIMUM\020\001\022\013\n\007MAXIMUM\020\002\"s\n\013FeatureFlag\022\022\n\n" +
"account_id\030\001 \001(\003\022\017\n\007feature\030\002 \001(\t\022\016\n\003pct" +
"\030\003 \001(\001:\0010\022\023\n\013whitelisted\030\004 \003(\t\022\032\n\022prior_" +
"feature_name\030\005 \001(\t\"\314\002\n\017LimitDefinition\022\r" +
"\n\005group\030\001 \001(\t\022D\n\013policy_name\030\002 \001(\0162/.it." +
"ratelim.data.LimitResponse.LimitPolicyNa" +
"mes\022\r\n\005limit\030\003 \001(\005\022\r\n\005burst\030\004 \001(\005\022\022\n\nacc" +
"ount_id\030\005 \001(\003\022\025\n\rlast_modified\030\006 \001(\003\022\022\n\n" +
"returnable\030\007 \001(\010\022R\n\014safety_level\030\010 \001(\0162," +
".it.ratelim.data.LimitDefinition.SafetyL",
"evel:\016L4_BEST_EFFORT\"3\n\013SafetyLevel\022\022\n\016L" +
"4_BEST_EFFORT\020\004\022\020\n\014L5_BOMBPROOF\020\005\"I\n\020Lim" +
"itDefinitions\0225\n\013definitions\030\001 \003(\0132 .it." +
"ratelim.data.LimitDefinition\";\n\014FeatureF" +
"lags\022+\n\005flags\030\001 \003(\0132\034.it.ratelim.data.Fe" +
"atureFlag\"P\n\013BucketWrite\0221\n\013tokenBucket\030" +
"\001 \001(\0132\034.it.ratelim.data.TokenBucket\022\016\n\006b" +
"ucket\030\002 \001(\t\"H\n\013TokenBucket\022\025\n\rcurrent_va" +
"lue\030\001 \001(\003\022\020\n\010time_key\030\002 \001(\003\022\020\n\010expiries\030" +
"\003 \003(\003B\021B\017RateLimitProtos"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
internal_static_it_ratelim_data_LimitResponse_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_it_ratelim_data_LimitResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_LimitResponse_descriptor,
new java.lang.String[] { "Passed", "ExpiresAt", "EnforcedGroup", "CurrentBucket", "PolicyGroup", "PolicyName", "PolicyLimit", "Amount", "LimitResetAt", "SafetyLevel", },
it.ratelim.data.RateLimitProtos.LimitResponse.class,
it.ratelim.data.RateLimitProtos.LimitResponse.Builder.class);
internal_static_it_ratelim_data_LimitRequest_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_it_ratelim_data_LimitRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_LimitRequest_descriptor,
new java.lang.String[] { "AccountId", "PartitionKey", "AcquireAmount", "Groups", "LimitCombiner", "PersistRequest", "AllowPartialResponse", },
it.ratelim.data.RateLimitProtos.LimitRequest.class,
it.ratelim.data.RateLimitProtos.LimitRequest.Builder.class);
internal_static_it_ratelim_data_FeatureFlag_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_it_ratelim_data_FeatureFlag_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_FeatureFlag_descriptor,
new java.lang.String[] { "AccountId", "Feature", "Pct", "Whitelisted", "PriorFeatureName", },
it.ratelim.data.RateLimitProtos.FeatureFlag.class,
it.ratelim.data.RateLimitProtos.FeatureFlag.Builder.class);
internal_static_it_ratelim_data_LimitDefinition_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_it_ratelim_data_LimitDefinition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_LimitDefinition_descriptor,
new java.lang.String[] { "Group", "PolicyName", "Limit", "Burst", "AccountId", "LastModified", "Returnable", "SafetyLevel", },
it.ratelim.data.RateLimitProtos.LimitDefinition.class,
it.ratelim.data.RateLimitProtos.LimitDefinition.Builder.class);
internal_static_it_ratelim_data_LimitDefinitions_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_it_ratelim_data_LimitDefinitions_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_LimitDefinitions_descriptor,
new java.lang.String[] { "Definitions", },
it.ratelim.data.RateLimitProtos.LimitDefinitions.class,
it.ratelim.data.RateLimitProtos.LimitDefinitions.Builder.class);
internal_static_it_ratelim_data_FeatureFlags_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_it_ratelim_data_FeatureFlags_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_FeatureFlags_descriptor,
new java.lang.String[] { "Flags", },
it.ratelim.data.RateLimitProtos.FeatureFlags.class,
it.ratelim.data.RateLimitProtos.FeatureFlags.Builder.class);
internal_static_it_ratelim_data_BucketWrite_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_it_ratelim_data_BucketWrite_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_BucketWrite_descriptor,
new java.lang.String[] { "TokenBucket", "Bucket", },
it.ratelim.data.RateLimitProtos.BucketWrite.class,
it.ratelim.data.RateLimitProtos.BucketWrite.Builder.class);
internal_static_it_ratelim_data_TokenBucket_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_it_ratelim_data_TokenBucket_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_it_ratelim_data_TokenBucket_descriptor,
new java.lang.String[] { "CurrentValue", "TimeKey", "Expiries", },
it.ratelim.data.RateLimitProtos.TokenBucket.class,
it.ratelim.data.RateLimitProtos.TokenBucket.Builder.class);
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy