All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.etcd.jetcd.api.Role Maven / Gradle / Ivy

There is a newer version: 0.8.4
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: auth.proto

package io.etcd.jetcd.api;

/**
 * 
 * Role is a single entry in the bucket authRoles
 * 
* * Protobuf type {@code authpb.Role} */ public final class Role extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:authpb.Role) RoleOrBuilder { private static final long serialVersionUID = 0L; // Use Role.newBuilder() to construct. private Role(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Role() { name_ = com.google.protobuf.ByteString.EMPTY; keyPermission_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance( UnusedPrivateParameter unused) { return new Role(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Role( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 10: { name_ = input.readBytes(); break; } case 18: { if (!((mutable_bitField0_ & 0x00000001) != 0)) { keyPermission_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000001; } keyPermission_.add( input.readMessage(io.etcd.jetcd.api.Permission.parser(), extensionRegistry)); break; } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000001) != 0)) { keyPermission_ = java.util.Collections.unmodifiableList(keyPermission_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.etcd.jetcd.api.Auth.internal_static_authpb_Role_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.etcd.jetcd.api.Auth.internal_static_authpb_Role_fieldAccessorTable .ensureFieldAccessorsInitialized( io.etcd.jetcd.api.Role.class, io.etcd.jetcd.api.Role.Builder.class); } public static final int NAME_FIELD_NUMBER = 1; private com.google.protobuf.ByteString name_; /** * bytes name = 1; * @return The name. */ public com.google.protobuf.ByteString getName() { return name_; } public static final int KEYPERMISSION_FIELD_NUMBER = 2; private java.util.List keyPermission_; /** * repeated .authpb.Permission keyPermission = 2; */ public java.util.List getKeyPermissionList() { return keyPermission_; } /** * repeated .authpb.Permission keyPermission = 2; */ public java.util.List getKeyPermissionOrBuilderList() { return keyPermission_; } /** * repeated .authpb.Permission keyPermission = 2; */ public int getKeyPermissionCount() { return keyPermission_.size(); } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.Permission getKeyPermission(int index) { return keyPermission_.get(index); } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.PermissionOrBuilder getKeyPermissionOrBuilder( int index) { return keyPermission_.get(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!name_.isEmpty()) { output.writeBytes(1, name_); } for (int i = 0; i < keyPermission_.size(); i++) { output.writeMessage(2, keyPermission_.get(i)); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!name_.isEmpty()) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, name_); } for (int i = 0; i < keyPermission_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, keyPermission_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.etcd.jetcd.api.Role)) { return super.equals(obj); } io.etcd.jetcd.api.Role other = (io.etcd.jetcd.api.Role) obj; if (!getName() .equals(other.getName())) return false; if (!getKeyPermissionList() .equals(other.getKeyPermissionList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (getKeyPermissionCount() > 0) { hash = (37 * hash) + KEYPERMISSION_FIELD_NUMBER; hash = (53 * hash) + getKeyPermissionList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static io.etcd.jetcd.api.Role parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.etcd.jetcd.api.Role parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.etcd.jetcd.api.Role parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.etcd.jetcd.api.Role parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.etcd.jetcd.api.Role parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static io.etcd.jetcd.api.Role parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static io.etcd.jetcd.api.Role parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.etcd.jetcd.api.Role parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static io.etcd.jetcd.api.Role parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static io.etcd.jetcd.api.Role parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static io.etcd.jetcd.api.Role parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static io.etcd.jetcd.api.Role parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(io.etcd.jetcd.api.Role prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * Role is a single entry in the bucket authRoles
   * 
* * Protobuf type {@code authpb.Role} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:authpb.Role) io.etcd.jetcd.api.RoleOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return io.etcd.jetcd.api.Auth.internal_static_authpb_Role_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return io.etcd.jetcd.api.Auth.internal_static_authpb_Role_fieldAccessorTable .ensureFieldAccessorsInitialized( io.etcd.jetcd.api.Role.class, io.etcd.jetcd.api.Role.Builder.class); } // Construct using io.etcd.jetcd.api.Role.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getKeyPermissionFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); name_ = com.google.protobuf.ByteString.EMPTY; if (keyPermissionBuilder_ == null) { keyPermission_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); } else { keyPermissionBuilder_.clear(); } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return io.etcd.jetcd.api.Auth.internal_static_authpb_Role_descriptor; } @java.lang.Override public io.etcd.jetcd.api.Role getDefaultInstanceForType() { return io.etcd.jetcd.api.Role.getDefaultInstance(); } @java.lang.Override public io.etcd.jetcd.api.Role build() { io.etcd.jetcd.api.Role result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public io.etcd.jetcd.api.Role buildPartial() { io.etcd.jetcd.api.Role result = new io.etcd.jetcd.api.Role(this); int from_bitField0_ = bitField0_; result.name_ = name_; if (keyPermissionBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { keyPermission_ = java.util.Collections.unmodifiableList(keyPermission_); bitField0_ = (bitField0_ & ~0x00000001); } result.keyPermission_ = keyPermission_; } else { result.keyPermission_ = keyPermissionBuilder_.build(); } onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof io.etcd.jetcd.api.Role) { return mergeFrom((io.etcd.jetcd.api.Role)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(io.etcd.jetcd.api.Role other) { if (other == io.etcd.jetcd.api.Role.getDefaultInstance()) return this; if (other.getName() != com.google.protobuf.ByteString.EMPTY) { setName(other.getName()); } if (keyPermissionBuilder_ == null) { if (!other.keyPermission_.isEmpty()) { if (keyPermission_.isEmpty()) { keyPermission_ = other.keyPermission_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureKeyPermissionIsMutable(); keyPermission_.addAll(other.keyPermission_); } onChanged(); } } else { if (!other.keyPermission_.isEmpty()) { if (keyPermissionBuilder_.isEmpty()) { keyPermissionBuilder_.dispose(); keyPermissionBuilder_ = null; keyPermission_ = other.keyPermission_; bitField0_ = (bitField0_ & ~0x00000001); keyPermissionBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getKeyPermissionFieldBuilder() : null; } else { keyPermissionBuilder_.addAllMessages(other.keyPermission_); } } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { io.etcd.jetcd.api.Role parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (io.etcd.jetcd.api.Role) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.protobuf.ByteString name_ = com.google.protobuf.ByteString.EMPTY; /** * bytes name = 1; * @return The name. */ public com.google.protobuf.ByteString getName() { return name_; } /** * bytes name = 1; * @param value The name to set. * @return This builder for chaining. */ public Builder setName(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } name_ = value; onChanged(); return this; } /** * bytes name = 1; * @return This builder for chaining. */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } private java.util.List keyPermission_ = java.util.Collections.emptyList(); private void ensureKeyPermissionIsMutable() { if (!((bitField0_ & 0x00000001) != 0)) { keyPermission_ = new java.util.ArrayList(keyPermission_); bitField0_ |= 0x00000001; } } private com.google.protobuf.RepeatedFieldBuilderV3< io.etcd.jetcd.api.Permission, io.etcd.jetcd.api.Permission.Builder, io.etcd.jetcd.api.PermissionOrBuilder> keyPermissionBuilder_; /** * repeated .authpb.Permission keyPermission = 2; */ public java.util.List getKeyPermissionList() { if (keyPermissionBuilder_ == null) { return java.util.Collections.unmodifiableList(keyPermission_); } else { return keyPermissionBuilder_.getMessageList(); } } /** * repeated .authpb.Permission keyPermission = 2; */ public int getKeyPermissionCount() { if (keyPermissionBuilder_ == null) { return keyPermission_.size(); } else { return keyPermissionBuilder_.getCount(); } } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.Permission getKeyPermission(int index) { if (keyPermissionBuilder_ == null) { return keyPermission_.get(index); } else { return keyPermissionBuilder_.getMessage(index); } } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder setKeyPermission( int index, io.etcd.jetcd.api.Permission value) { if (keyPermissionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyPermissionIsMutable(); keyPermission_.set(index, value); onChanged(); } else { keyPermissionBuilder_.setMessage(index, value); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder setKeyPermission( int index, io.etcd.jetcd.api.Permission.Builder builderForValue) { if (keyPermissionBuilder_ == null) { ensureKeyPermissionIsMutable(); keyPermission_.set(index, builderForValue.build()); onChanged(); } else { keyPermissionBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder addKeyPermission(io.etcd.jetcd.api.Permission value) { if (keyPermissionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyPermissionIsMutable(); keyPermission_.add(value); onChanged(); } else { keyPermissionBuilder_.addMessage(value); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder addKeyPermission( int index, io.etcd.jetcd.api.Permission value) { if (keyPermissionBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureKeyPermissionIsMutable(); keyPermission_.add(index, value); onChanged(); } else { keyPermissionBuilder_.addMessage(index, value); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder addKeyPermission( io.etcd.jetcd.api.Permission.Builder builderForValue) { if (keyPermissionBuilder_ == null) { ensureKeyPermissionIsMutable(); keyPermission_.add(builderForValue.build()); onChanged(); } else { keyPermissionBuilder_.addMessage(builderForValue.build()); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder addKeyPermission( int index, io.etcd.jetcd.api.Permission.Builder builderForValue) { if (keyPermissionBuilder_ == null) { ensureKeyPermissionIsMutable(); keyPermission_.add(index, builderForValue.build()); onChanged(); } else { keyPermissionBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder addAllKeyPermission( java.lang.Iterable values) { if (keyPermissionBuilder_ == null) { ensureKeyPermissionIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, keyPermission_); onChanged(); } else { keyPermissionBuilder_.addAllMessages(values); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder clearKeyPermission() { if (keyPermissionBuilder_ == null) { keyPermission_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { keyPermissionBuilder_.clear(); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public Builder removeKeyPermission(int index) { if (keyPermissionBuilder_ == null) { ensureKeyPermissionIsMutable(); keyPermission_.remove(index); onChanged(); } else { keyPermissionBuilder_.remove(index); } return this; } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.Permission.Builder getKeyPermissionBuilder( int index) { return getKeyPermissionFieldBuilder().getBuilder(index); } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.PermissionOrBuilder getKeyPermissionOrBuilder( int index) { if (keyPermissionBuilder_ == null) { return keyPermission_.get(index); } else { return keyPermissionBuilder_.getMessageOrBuilder(index); } } /** * repeated .authpb.Permission keyPermission = 2; */ public java.util.List getKeyPermissionOrBuilderList() { if (keyPermissionBuilder_ != null) { return keyPermissionBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(keyPermission_); } } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.Permission.Builder addKeyPermissionBuilder() { return getKeyPermissionFieldBuilder().addBuilder( io.etcd.jetcd.api.Permission.getDefaultInstance()); } /** * repeated .authpb.Permission keyPermission = 2; */ public io.etcd.jetcd.api.Permission.Builder addKeyPermissionBuilder( int index) { return getKeyPermissionFieldBuilder().addBuilder( index, io.etcd.jetcd.api.Permission.getDefaultInstance()); } /** * repeated .authpb.Permission keyPermission = 2; */ public java.util.List getKeyPermissionBuilderList() { return getKeyPermissionFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< io.etcd.jetcd.api.Permission, io.etcd.jetcd.api.Permission.Builder, io.etcd.jetcd.api.PermissionOrBuilder> getKeyPermissionFieldBuilder() { if (keyPermissionBuilder_ == null) { keyPermissionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< io.etcd.jetcd.api.Permission, io.etcd.jetcd.api.Permission.Builder, io.etcd.jetcd.api.PermissionOrBuilder>( keyPermission_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); keyPermission_ = null; } return keyPermissionBuilder_; } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:authpb.Role) } // @@protoc_insertion_point(class_scope:authpb.Role) private static final io.etcd.jetcd.api.Role DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new io.etcd.jetcd.api.Role(); } public static io.etcd.jetcd.api.Role getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Role parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Role(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override public io.etcd.jetcd.api.Role getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy