sawtooth.identity.protobuf.RoleList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sawtooth-sdk-protos Show documentation
Show all versions of sawtooth-sdk-protos Show documentation
"Java classes generated from Sawtooth proto definition files, to interact with the component, consensus, and other validator interfaces"
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: identity.proto
package sawtooth.identity.protobuf;
/**
*
* Roles will be stored in a RoleList to account for state collisions
*
*
* Protobuf type {@code RoleList}
*/
public final class RoleList extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:RoleList)
RoleListOrBuilder {
private static final long serialVersionUID = 0L;
// Use RoleList.newBuilder() to construct.
private RoleList(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private RoleList() {
roles_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private RoleList(
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: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
roles_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
roles_.add(
input.readMessage(sawtooth.identity.protobuf.Role.parser(), extensionRegistry));
break;
}
default: {
if (!parseUnknownFieldProto3(
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) == 0x00000001)) {
roles_ = java.util.Collections.unmodifiableList(roles_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return sawtooth.identity.protobuf.Identity.internal_static_RoleList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return sawtooth.identity.protobuf.Identity.internal_static_RoleList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
sawtooth.identity.protobuf.RoleList.class, sawtooth.identity.protobuf.RoleList.Builder.class);
}
public static final int ROLES_FIELD_NUMBER = 1;
private java.util.List roles_;
/**
* repeated .Role roles = 1;
*/
public java.util.List getRolesList() {
return roles_;
}
/**
* repeated .Role roles = 1;
*/
public java.util.List extends sawtooth.identity.protobuf.RoleOrBuilder>
getRolesOrBuilderList() {
return roles_;
}
/**
* repeated .Role roles = 1;
*/
public int getRolesCount() {
return roles_.size();
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.Role getRoles(int index) {
return roles_.get(index);
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.RoleOrBuilder getRolesOrBuilder(
int index) {
return roles_.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 {
for (int i = 0; i < roles_.size(); i++) {
output.writeMessage(1, roles_.get(i));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < roles_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, roles_.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 sawtooth.identity.protobuf.RoleList)) {
return super.equals(obj);
}
sawtooth.identity.protobuf.RoleList other = (sawtooth.identity.protobuf.RoleList) obj;
boolean result = true;
result = result && getRolesList()
.equals(other.getRolesList());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (getRolesCount() > 0) {
hash = (37 * hash) + ROLES_FIELD_NUMBER;
hash = (53 * hash) + getRolesList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static sawtooth.identity.protobuf.RoleList parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static sawtooth.identity.protobuf.RoleList parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static sawtooth.identity.protobuf.RoleList 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 sawtooth.identity.protobuf.RoleList parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static sawtooth.identity.protobuf.RoleList 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 sawtooth.identity.protobuf.RoleList parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static sawtooth.identity.protobuf.RoleList 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(sawtooth.identity.protobuf.RoleList 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;
}
/**
*
* Roles will be stored in a RoleList to account for state collisions
*
*
* Protobuf type {@code RoleList}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:RoleList)
sawtooth.identity.protobuf.RoleListOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return sawtooth.identity.protobuf.Identity.internal_static_RoleList_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return sawtooth.identity.protobuf.Identity.internal_static_RoleList_fieldAccessorTable
.ensureFieldAccessorsInitialized(
sawtooth.identity.protobuf.RoleList.class, sawtooth.identity.protobuf.RoleList.Builder.class);
}
// Construct using sawtooth.identity.protobuf.RoleList.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getRolesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (rolesBuilder_ == null) {
roles_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
rolesBuilder_.clear();
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return sawtooth.identity.protobuf.Identity.internal_static_RoleList_descriptor;
}
@java.lang.Override
public sawtooth.identity.protobuf.RoleList getDefaultInstanceForType() {
return sawtooth.identity.protobuf.RoleList.getDefaultInstance();
}
@java.lang.Override
public sawtooth.identity.protobuf.RoleList build() {
sawtooth.identity.protobuf.RoleList result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public sawtooth.identity.protobuf.RoleList buildPartial() {
sawtooth.identity.protobuf.RoleList result = new sawtooth.identity.protobuf.RoleList(this);
int from_bitField0_ = bitField0_;
if (rolesBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
roles_ = java.util.Collections.unmodifiableList(roles_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.roles_ = roles_;
} else {
result.roles_ = rolesBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof sawtooth.identity.protobuf.RoleList) {
return mergeFrom((sawtooth.identity.protobuf.RoleList)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(sawtooth.identity.protobuf.RoleList other) {
if (other == sawtooth.identity.protobuf.RoleList.getDefaultInstance()) return this;
if (rolesBuilder_ == null) {
if (!other.roles_.isEmpty()) {
if (roles_.isEmpty()) {
roles_ = other.roles_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureRolesIsMutable();
roles_.addAll(other.roles_);
}
onChanged();
}
} else {
if (!other.roles_.isEmpty()) {
if (rolesBuilder_.isEmpty()) {
rolesBuilder_.dispose();
rolesBuilder_ = null;
roles_ = other.roles_;
bitField0_ = (bitField0_ & ~0x00000001);
rolesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getRolesFieldBuilder() : null;
} else {
rolesBuilder_.addAllMessages(other.roles_);
}
}
}
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 {
sawtooth.identity.protobuf.RoleList parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (sawtooth.identity.protobuf.RoleList) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List roles_ =
java.util.Collections.emptyList();
private void ensureRolesIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
roles_ = new java.util.ArrayList(roles_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.identity.protobuf.Role, sawtooth.identity.protobuf.Role.Builder, sawtooth.identity.protobuf.RoleOrBuilder> rolesBuilder_;
/**
* repeated .Role roles = 1;
*/
public java.util.List getRolesList() {
if (rolesBuilder_ == null) {
return java.util.Collections.unmodifiableList(roles_);
} else {
return rolesBuilder_.getMessageList();
}
}
/**
* repeated .Role roles = 1;
*/
public int getRolesCount() {
if (rolesBuilder_ == null) {
return roles_.size();
} else {
return rolesBuilder_.getCount();
}
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.Role getRoles(int index) {
if (rolesBuilder_ == null) {
return roles_.get(index);
} else {
return rolesBuilder_.getMessage(index);
}
}
/**
* repeated .Role roles = 1;
*/
public Builder setRoles(
int index, sawtooth.identity.protobuf.Role value) {
if (rolesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRolesIsMutable();
roles_.set(index, value);
onChanged();
} else {
rolesBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder setRoles(
int index, sawtooth.identity.protobuf.Role.Builder builderForValue) {
if (rolesBuilder_ == null) {
ensureRolesIsMutable();
roles_.set(index, builderForValue.build());
onChanged();
} else {
rolesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder addRoles(sawtooth.identity.protobuf.Role value) {
if (rolesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRolesIsMutable();
roles_.add(value);
onChanged();
} else {
rolesBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder addRoles(
int index, sawtooth.identity.protobuf.Role value) {
if (rolesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRolesIsMutable();
roles_.add(index, value);
onChanged();
} else {
rolesBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder addRoles(
sawtooth.identity.protobuf.Role.Builder builderForValue) {
if (rolesBuilder_ == null) {
ensureRolesIsMutable();
roles_.add(builderForValue.build());
onChanged();
} else {
rolesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder addRoles(
int index, sawtooth.identity.protobuf.Role.Builder builderForValue) {
if (rolesBuilder_ == null) {
ensureRolesIsMutable();
roles_.add(index, builderForValue.build());
onChanged();
} else {
rolesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder addAllRoles(
java.lang.Iterable extends sawtooth.identity.protobuf.Role> values) {
if (rolesBuilder_ == null) {
ensureRolesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, roles_);
onChanged();
} else {
rolesBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder clearRoles() {
if (rolesBuilder_ == null) {
roles_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
rolesBuilder_.clear();
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public Builder removeRoles(int index) {
if (rolesBuilder_ == null) {
ensureRolesIsMutable();
roles_.remove(index);
onChanged();
} else {
rolesBuilder_.remove(index);
}
return this;
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.Role.Builder getRolesBuilder(
int index) {
return getRolesFieldBuilder().getBuilder(index);
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.RoleOrBuilder getRolesOrBuilder(
int index) {
if (rolesBuilder_ == null) {
return roles_.get(index); } else {
return rolesBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .Role roles = 1;
*/
public java.util.List extends sawtooth.identity.protobuf.RoleOrBuilder>
getRolesOrBuilderList() {
if (rolesBuilder_ != null) {
return rolesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(roles_);
}
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.Role.Builder addRolesBuilder() {
return getRolesFieldBuilder().addBuilder(
sawtooth.identity.protobuf.Role.getDefaultInstance());
}
/**
* repeated .Role roles = 1;
*/
public sawtooth.identity.protobuf.Role.Builder addRolesBuilder(
int index) {
return getRolesFieldBuilder().addBuilder(
index, sawtooth.identity.protobuf.Role.getDefaultInstance());
}
/**
* repeated .Role roles = 1;
*/
public java.util.List
getRolesBuilderList() {
return getRolesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.identity.protobuf.Role, sawtooth.identity.protobuf.Role.Builder, sawtooth.identity.protobuf.RoleOrBuilder>
getRolesFieldBuilder() {
if (rolesBuilder_ == null) {
rolesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
sawtooth.identity.protobuf.Role, sawtooth.identity.protobuf.Role.Builder, sawtooth.identity.protobuf.RoleOrBuilder>(
roles_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
roles_ = null;
}
return rolesBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:RoleList)
}
// @@protoc_insertion_point(class_scope:RoleList)
private static final sawtooth.identity.protobuf.RoleList DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new sawtooth.identity.protobuf.RoleList();
}
public static sawtooth.identity.protobuf.RoleList getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public RoleList parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RoleList(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 sawtooth.identity.protobuf.RoleList getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}