org.hyperledger.fabric.protos.common.Policies Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fabric-sdk-java Show documentation
Show all versions of fabric-sdk-java Show documentation
Java SDK for Hyperledger fabric project
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: common/policies.proto
package org.hyperledger.fabric.protos.common;
public final class Policies {
private Policies() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface PolicyOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.Policy)
com.google.protobuf.MessageOrBuilder {
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* int32 type = 1;
* @return The type.
*/
int getType();
/**
* bytes value = 2;
* @return The value.
*/
com.google.protobuf.ByteString getValue();
}
/**
*
* Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support
* multiple policy engines, this is typed as a oneof for now
*
*
* Protobuf type {@code common.Policy}
*/
public static final class Policy extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.Policy)
PolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use Policy.newBuilder() to construct.
private Policy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Policy() {
value_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new Policy();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.Policy.class, org.hyperledger.fabric.protos.common.Policies.Policy.Builder.class);
}
/**
* Protobuf enum {@code common.Policy.PolicyType}
*/
public enum PolicyType
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Reserved to check for proper initialization
*
*
* UNKNOWN = 0;
*/
UNKNOWN(0),
/**
* SIGNATURE = 1;
*/
SIGNATURE(1),
/**
* MSP = 2;
*/
MSP(2),
/**
* IMPLICIT_META = 3;
*/
IMPLICIT_META(3),
UNRECOGNIZED(-1),
;
/**
*
* Reserved to check for proper initialization
*
*
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
* SIGNATURE = 1;
*/
public static final int SIGNATURE_VALUE = 1;
/**
* MSP = 2;
*/
public static final int MSP_VALUE = 2;
/**
* IMPLICIT_META = 3;
*/
public static final int IMPLICIT_META_VALUE = 3;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static PolicyType valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static PolicyType forNumber(int value) {
switch (value) {
case 0: return UNKNOWN;
case 1: return SIGNATURE;
case 2: return MSP;
case 3: return IMPLICIT_META;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
PolicyType> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public PolicyType findValueByNumber(int number) {
return PolicyType.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.Policy.getDescriptor().getEnumTypes().get(0);
}
private static final PolicyType[] VALUES = values();
public static PolicyType valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private PolicyType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:common.Policy.PolicyType)
}
public static final int TYPE_FIELD_NUMBER = 1;
private int type_ = 0;
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* int32 type = 1;
* @return The type.
*/
@java.lang.Override
public int getType() {
return type_;
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
/**
* bytes value = 2;
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return value_;
}
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 (type_ != 0) {
output.writeInt32(1, type_);
}
if (!value_.isEmpty()) {
output.writeBytes(2, value_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, type_);
}
if (!value_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, value_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.Policy)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.Policy other = (org.hyperledger.fabric.protos.common.Policies.Policy) obj;
if (getType()
!= other.getType()) return false;
if (!getValue()
.equals(other.getValue())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType();
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + getValue().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy 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 org.hyperledger.fabric.protos.common.Policies.Policy parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy 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 org.hyperledger.fabric.protos.common.Policies.Policy parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.Policy 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(org.hyperledger.fabric.protos.common.Policies.Policy 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;
}
/**
*
* Policy expresses a policy which the orderer can evaluate, because there has been some desire expressed to support
* multiple policy engines, this is typed as a oneof for now
*
*
* Protobuf type {@code common.Policy}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.Policy)
org.hyperledger.fabric.protos.common.Policies.PolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.Policy.class, org.hyperledger.fabric.protos.common.Policies.Policy.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.Policy.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
type_ = 0;
value_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.Policy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.Policy.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.Policy build() {
org.hyperledger.fabric.protos.common.Policies.Policy result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.Policy buildPartial() {
org.hyperledger.fabric.protos.common.Policies.Policy result = new org.hyperledger.fabric.protos.common.Policies.Policy(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.Policy result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.type_ = type_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.value_ = value_;
}
}
@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 org.hyperledger.fabric.protos.common.Policies.Policy) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.Policy)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.Policy other) {
if (other == org.hyperledger.fabric.protos.common.Policies.Policy.getDefaultInstance()) return this;
if (other.getType() != 0) {
setType(other.getType());
}
if (other.getValue() != com.google.protobuf.ByteString.EMPTY) {
setValue(other.getValue());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
type_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
value_ = input.readBytes();
bitField0_ |= 0x00000002;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int type_ ;
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* int32 type = 1;
* @return The type.
*/
@java.lang.Override
public int getType() {
return type_;
}
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* int32 type = 1;
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(int value) {
type_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* int32 type = 1;
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000001);
type_ = 0;
onChanged();
return this;
}
private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
/**
* bytes value = 2;
* @return The value.
*/
@java.lang.Override
public com.google.protobuf.ByteString getValue() {
return value_;
}
/**
* bytes value = 2;
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
value_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* bytes value = 2;
* @return This builder for chaining.
*/
public Builder clearValue() {
bitField0_ = (bitField0_ & ~0x00000002);
value_ = getDefaultInstance().getValue();
onChanged();
return this;
}
@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:common.Policy)
}
// @@protoc_insertion_point(class_scope:common.Policy)
private static final org.hyperledger.fabric.protos.common.Policies.Policy DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.Policy();
}
public static org.hyperledger.fabric.protos.common.Policies.Policy getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Policy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.Policy getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface SignaturePolicyEnvelopeOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.SignaturePolicyEnvelope)
com.google.protobuf.MessageOrBuilder {
/**
* int32 version = 1;
* @return The version.
*/
int getVersion();
/**
* .common.SignaturePolicy rule = 2;
* @return Whether the rule field is set.
*/
boolean hasRule();
/**
* .common.SignaturePolicy rule = 2;
* @return The rule.
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRule();
/**
* .common.SignaturePolicy rule = 2;
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRuleOrBuilder();
/**
* repeated .common.MSPPrincipal identities = 3;
*/
java.util.List
getIdentitiesList();
/**
* repeated .common.MSPPrincipal identities = 3;
*/
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getIdentities(int index);
/**
* repeated .common.MSPPrincipal identities = 3;
*/
int getIdentitiesCount();
/**
* repeated .common.MSPPrincipal identities = 3;
*/
java.util.List extends org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder>
getIdentitiesOrBuilderList();
/**
* repeated .common.MSPPrincipal identities = 3;
*/
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder getIdentitiesOrBuilder(
int index);
}
/**
*
* SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements
*
*
* Protobuf type {@code common.SignaturePolicyEnvelope}
*/
public static final class SignaturePolicyEnvelope extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.SignaturePolicyEnvelope)
SignaturePolicyEnvelopeOrBuilder {
private static final long serialVersionUID = 0L;
// Use SignaturePolicyEnvelope.newBuilder() to construct.
private SignaturePolicyEnvelope(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private SignaturePolicyEnvelope() {
identities_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SignaturePolicyEnvelope();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicyEnvelope_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicyEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder.class);
}
private int bitField0_;
public static final int VERSION_FIELD_NUMBER = 1;
private int version_ = 0;
/**
* int32 version = 1;
* @return The version.
*/
@java.lang.Override
public int getVersion() {
return version_;
}
public static final int RULE_FIELD_NUMBER = 2;
private org.hyperledger.fabric.protos.common.Policies.SignaturePolicy rule_;
/**
* .common.SignaturePolicy rule = 2;
* @return Whether the rule field is set.
*/
@java.lang.Override
public boolean hasRule() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
* .common.SignaturePolicy rule = 2;
* @return The rule.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRule() {
return rule_ == null ? org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance() : rule_;
}
/**
* .common.SignaturePolicy rule = 2;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRuleOrBuilder() {
return rule_ == null ? org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance() : rule_;
}
public static final int IDENTITIES_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List identities_;
/**
* repeated .common.MSPPrincipal identities = 3;
*/
@java.lang.Override
public java.util.List getIdentitiesList() {
return identities_;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
@java.lang.Override
public java.util.List extends org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder>
getIdentitiesOrBuilderList() {
return identities_;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
@java.lang.Override
public int getIdentitiesCount() {
return identities_.size();
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getIdentities(int index) {
return identities_.get(index);
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder getIdentitiesOrBuilder(
int index) {
return identities_.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 (version_ != 0) {
output.writeInt32(1, version_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getRule());
}
for (int i = 0; i < identities_.size(); i++) {
output.writeMessage(3, identities_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (version_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, version_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getRule());
}
for (int i = 0; i < identities_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, identities_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope other = (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) obj;
if (getVersion()
!= other.getVersion()) return false;
if (hasRule() != other.hasRule()) return false;
if (hasRule()) {
if (!getRule()
.equals(other.getRule())) return false;
}
if (!getIdentitiesList()
.equals(other.getIdentitiesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + VERSION_FIELD_NUMBER;
hash = (53 * hash) + getVersion();
if (hasRule()) {
hash = (37 * hash) + RULE_FIELD_NUMBER;
hash = (53 * hash) + getRule().hashCode();
}
if (getIdentitiesCount() > 0) {
hash = (37 * hash) + IDENTITIES_FIELD_NUMBER;
hash = (53 * hash) + getIdentitiesList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope 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(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope 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;
}
/**
*
* SignaturePolicyEnvelope wraps a SignaturePolicy and includes a version for future enhancements
*
*
* Protobuf type {@code common.SignaturePolicyEnvelope}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.SignaturePolicyEnvelope)
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicyEnvelope_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicyEnvelope_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getRuleFieldBuilder();
getIdentitiesFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
version_ = 0;
rule_ = null;
if (ruleBuilder_ != null) {
ruleBuilder_.dispose();
ruleBuilder_ = null;
}
if (identitiesBuilder_ == null) {
identities_ = java.util.Collections.emptyList();
} else {
identities_ = null;
identitiesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicyEnvelope_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope build() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope buildPartial() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope result = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope result) {
if (identitiesBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
identities_ = java.util.Collections.unmodifiableList(identities_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.identities_ = identities_;
} else {
result.identities_ = identitiesBuilder_.build();
}
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.version_ = version_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.rule_ = ruleBuilder_ == null
? rule_
: ruleBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope other) {
if (other == org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance()) return this;
if (other.getVersion() != 0) {
setVersion(other.getVersion());
}
if (other.hasRule()) {
mergeRule(other.getRule());
}
if (identitiesBuilder_ == null) {
if (!other.identities_.isEmpty()) {
if (identities_.isEmpty()) {
identities_ = other.identities_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureIdentitiesIsMutable();
identities_.addAll(other.identities_);
}
onChanged();
}
} else {
if (!other.identities_.isEmpty()) {
if (identitiesBuilder_.isEmpty()) {
identitiesBuilder_.dispose();
identitiesBuilder_ = null;
identities_ = other.identities_;
bitField0_ = (bitField0_ & ~0x00000004);
identitiesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getIdentitiesFieldBuilder() : null;
} else {
identitiesBuilder_.addAllMessages(other.identities_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
version_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
input.readMessage(
getRuleFieldBuilder().getBuilder(),
extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26: {
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal m =
input.readMessage(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.parser(),
extensionRegistry);
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
identities_.add(m);
} else {
identitiesBuilder_.addMessage(m);
}
break;
} // case 26
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int version_ ;
/**
* int32 version = 1;
* @return The version.
*/
@java.lang.Override
public int getVersion() {
return version_;
}
/**
* int32 version = 1;
* @param value The version to set.
* @return This builder for chaining.
*/
public Builder setVersion(int value) {
version_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* int32 version = 1;
* @return This builder for chaining.
*/
public Builder clearVersion() {
bitField0_ = (bitField0_ & ~0x00000001);
version_ = 0;
onChanged();
return this;
}
private org.hyperledger.fabric.protos.common.Policies.SignaturePolicy rule_;
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder> ruleBuilder_;
/**
* .common.SignaturePolicy rule = 2;
* @return Whether the rule field is set.
*/
public boolean hasRule() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
* .common.SignaturePolicy rule = 2;
* @return The rule.
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRule() {
if (ruleBuilder_ == null) {
return rule_ == null ? org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance() : rule_;
} else {
return ruleBuilder_.getMessage();
}
}
/**
* .common.SignaturePolicy rule = 2;
*/
public Builder setRule(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy value) {
if (ruleBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
rule_ = value;
} else {
ruleBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* .common.SignaturePolicy rule = 2;
*/
public Builder setRule(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder builderForValue) {
if (ruleBuilder_ == null) {
rule_ = builderForValue.build();
} else {
ruleBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* .common.SignaturePolicy rule = 2;
*/
public Builder mergeRule(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy value) {
if (ruleBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0) &&
rule_ != null &&
rule_ != org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance()) {
getRuleBuilder().mergeFrom(value);
} else {
rule_ = value;
}
} else {
ruleBuilder_.mergeFrom(value);
}
if (rule_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
* .common.SignaturePolicy rule = 2;
*/
public Builder clearRule() {
bitField0_ = (bitField0_ & ~0x00000002);
rule_ = null;
if (ruleBuilder_ != null) {
ruleBuilder_.dispose();
ruleBuilder_ = null;
}
onChanged();
return this;
}
/**
* .common.SignaturePolicy rule = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder getRuleBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getRuleFieldBuilder().getBuilder();
}
/**
* .common.SignaturePolicy rule = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRuleOrBuilder() {
if (ruleBuilder_ != null) {
return ruleBuilder_.getMessageOrBuilder();
} else {
return rule_ == null ?
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance() : rule_;
}
}
/**
* .common.SignaturePolicy rule = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>
getRuleFieldBuilder() {
if (ruleBuilder_ == null) {
ruleBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>(
getRule(),
getParentForChildren(),
isClean());
rule_ = null;
}
return ruleBuilder_;
}
private java.util.List identities_ =
java.util.Collections.emptyList();
private void ensureIdentitiesIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
identities_ = new java.util.ArrayList(identities_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder> identitiesBuilder_;
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public java.util.List getIdentitiesList() {
if (identitiesBuilder_ == null) {
return java.util.Collections.unmodifiableList(identities_);
} else {
return identitiesBuilder_.getMessageList();
}
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public int getIdentitiesCount() {
if (identitiesBuilder_ == null) {
return identities_.size();
} else {
return identitiesBuilder_.getCount();
}
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal getIdentities(int index) {
if (identitiesBuilder_ == null) {
return identities_.get(index);
} else {
return identitiesBuilder_.getMessage(index);
}
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder setIdentities(
int index, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal value) {
if (identitiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureIdentitiesIsMutable();
identities_.set(index, value);
onChanged();
} else {
identitiesBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder setIdentities(
int index, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder builderForValue) {
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
identities_.set(index, builderForValue.build());
onChanged();
} else {
identitiesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder addIdentities(org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal value) {
if (identitiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureIdentitiesIsMutable();
identities_.add(value);
onChanged();
} else {
identitiesBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder addIdentities(
int index, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal value) {
if (identitiesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureIdentitiesIsMutable();
identities_.add(index, value);
onChanged();
} else {
identitiesBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder addIdentities(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder builderForValue) {
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
identities_.add(builderForValue.build());
onChanged();
} else {
identitiesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder addIdentities(
int index, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder builderForValue) {
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
identities_.add(index, builderForValue.build());
onChanged();
} else {
identitiesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder addAllIdentities(
java.lang.Iterable extends org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal> values) {
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, identities_);
onChanged();
} else {
identitiesBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder clearIdentities() {
if (identitiesBuilder_ == null) {
identities_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
identitiesBuilder_.clear();
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public Builder removeIdentities(int index) {
if (identitiesBuilder_ == null) {
ensureIdentitiesIsMutable();
identities_.remove(index);
onChanged();
} else {
identitiesBuilder_.remove(index);
}
return this;
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder getIdentitiesBuilder(
int index) {
return getIdentitiesFieldBuilder().getBuilder(index);
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder getIdentitiesOrBuilder(
int index) {
if (identitiesBuilder_ == null) {
return identities_.get(index); } else {
return identitiesBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public java.util.List extends org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder>
getIdentitiesOrBuilderList() {
if (identitiesBuilder_ != null) {
return identitiesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(identities_);
}
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder addIdentitiesBuilder() {
return getIdentitiesFieldBuilder().addBuilder(
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.getDefaultInstance());
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder addIdentitiesBuilder(
int index) {
return getIdentitiesFieldBuilder().addBuilder(
index, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.getDefaultInstance());
}
/**
* repeated .common.MSPPrincipal identities = 3;
*/
public java.util.List
getIdentitiesBuilderList() {
return getIdentitiesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder>
getIdentitiesFieldBuilder() {
if (identitiesBuilder_ == null) {
identitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipal.Builder, org.hyperledger.fabric.protos.common.MspPrincipal.MSPPrincipalOrBuilder>(
identities_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
identities_ = null;
}
return identitiesBuilder_;
}
@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:common.SignaturePolicyEnvelope)
}
// @@protoc_insertion_point(class_scope:common.SignaturePolicyEnvelope)
private static final org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope();
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SignaturePolicyEnvelope parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface SignaturePolicyOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.SignaturePolicy)
com.google.protobuf.MessageOrBuilder {
/**
* int32 signed_by = 1;
* @return Whether the signedBy field is set.
*/
boolean hasSignedBy();
/**
* int32 signed_by = 1;
* @return The signedBy.
*/
int getSignedBy();
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return Whether the nOutOf field is set.
*/
boolean hasNOutOf();
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return The nOutOf.
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getNOutOf();
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder getNOutOfOrBuilder();
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.TypeCase getTypeCase();
}
/**
*
* SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing
* policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent
* to express AND as well as OR, as well as of course N out of the following M policies
* SignedBy implies that the signature is from a valid certificate which is signed by the trusted
* authority specified in the bytes. This will be the certificate itself for a self-signed certificate
* and will be the CA for more traditional certificates
*
*
* Protobuf type {@code common.SignaturePolicy}
*/
public static final class SignaturePolicy extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.SignaturePolicy)
SignaturePolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use SignaturePolicy.newBuilder() to construct.
private SignaturePolicy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private SignaturePolicy() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new SignaturePolicy();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder.class);
}
public interface NOutOfOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.SignaturePolicy.NOutOf)
com.google.protobuf.MessageOrBuilder {
/**
* int32 n = 1;
* @return The n.
*/
int getN();
/**
* repeated .common.SignaturePolicy rules = 2;
*/
java.util.List
getRulesList();
/**
* repeated .common.SignaturePolicy rules = 2;
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRules(int index);
/**
* repeated .common.SignaturePolicy rules = 2;
*/
int getRulesCount();
/**
* repeated .common.SignaturePolicy rules = 2;
*/
java.util.List extends org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>
getRulesOrBuilderList();
/**
* repeated .common.SignaturePolicy rules = 2;
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRulesOrBuilder(
int index);
}
/**
* Protobuf type {@code common.SignaturePolicy.NOutOf}
*/
public static final class NOutOf extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.SignaturePolicy.NOutOf)
NOutOfOrBuilder {
private static final long serialVersionUID = 0L;
// Use NOutOf.newBuilder() to construct.
private NOutOf(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private NOutOf() {
rules_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new NOutOf();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder.class);
}
public static final int N_FIELD_NUMBER = 1;
private int n_ = 0;
/**
* int32 n = 1;
* @return The n.
*/
@java.lang.Override
public int getN() {
return n_;
}
public static final int RULES_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List rules_;
/**
* repeated .common.SignaturePolicy rules = 2;
*/
@java.lang.Override
public java.util.List getRulesList() {
return rules_;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
@java.lang.Override
public java.util.List extends org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>
getRulesOrBuilderList() {
return rules_;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
@java.lang.Override
public int getRulesCount() {
return rules_.size();
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRules(int index) {
return rules_.get(index);
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRulesOrBuilder(
int index) {
return rules_.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 (n_ != 0) {
output.writeInt32(1, n_);
}
for (int i = 0; i < rules_.size(); i++) {
output.writeMessage(2, rules_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (n_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, n_);
}
for (int i = 0; i < rules_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, rules_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf other = (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) obj;
if (getN()
!= other.getN()) return false;
if (!getRulesList()
.equals(other.getRulesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + N_FIELD_NUMBER;
hash = (53 * hash) + getN();
if (getRulesCount() > 0) {
hash = (37 * hash) + RULES_FIELD_NUMBER;
hash = (53 * hash) + getRulesList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf 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(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf 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;
}
/**
* Protobuf type {@code common.SignaturePolicy.NOutOf}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.SignaturePolicy.NOutOf)
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
n_ = 0;
if (rulesBuilder_ == null) {
rules_ = java.util.Collections.emptyList();
} else {
rules_ = null;
rulesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf build() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf buildPartial() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf result = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf result) {
if (rulesBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
rules_ = java.util.Collections.unmodifiableList(rules_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.rules_ = rules_;
} else {
result.rules_ = rulesBuilder_.build();
}
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.n_ = n_;
}
}
@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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf other) {
if (other == org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance()) return this;
if (other.getN() != 0) {
setN(other.getN());
}
if (rulesBuilder_ == null) {
if (!other.rules_.isEmpty()) {
if (rules_.isEmpty()) {
rules_ = other.rules_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureRulesIsMutable();
rules_.addAll(other.rules_);
}
onChanged();
}
} else {
if (!other.rules_.isEmpty()) {
if (rulesBuilder_.isEmpty()) {
rulesBuilder_.dispose();
rulesBuilder_ = null;
rules_ = other.rules_;
bitField0_ = (bitField0_ & ~0x00000002);
rulesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getRulesFieldBuilder() : null;
} else {
rulesBuilder_.addAllMessages(other.rules_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
n_ = input.readInt32();
bitField0_ |= 0x00000001;
break;
} // case 8
case 18: {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy m =
input.readMessage(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.parser(),
extensionRegistry);
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.add(m);
} else {
rulesBuilder_.addMessage(m);
}
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private int n_ ;
/**
* int32 n = 1;
* @return The n.
*/
@java.lang.Override
public int getN() {
return n_;
}
/**
* int32 n = 1;
* @param value The n to set.
* @return This builder for chaining.
*/
public Builder setN(int value) {
n_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* int32 n = 1;
* @return This builder for chaining.
*/
public Builder clearN() {
bitField0_ = (bitField0_ & ~0x00000001);
n_ = 0;
onChanged();
return this;
}
private java.util.List rules_ =
java.util.Collections.emptyList();
private void ensureRulesIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
rules_ = new java.util.ArrayList(rules_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder> rulesBuilder_;
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public java.util.List getRulesList() {
if (rulesBuilder_ == null) {
return java.util.Collections.unmodifiableList(rules_);
} else {
return rulesBuilder_.getMessageList();
}
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public int getRulesCount() {
if (rulesBuilder_ == null) {
return rules_.size();
} else {
return rulesBuilder_.getCount();
}
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRules(int index) {
if (rulesBuilder_ == null) {
return rules_.get(index);
} else {
return rulesBuilder_.getMessage(index);
}
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder setRules(
int index, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.set(index, value);
onChanged();
} else {
rulesBuilder_.setMessage(index, value);
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder setRules(
int index, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.set(index, builderForValue.build());
onChanged();
} else {
rulesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder addRules(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.add(value);
onChanged();
} else {
rulesBuilder_.addMessage(value);
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder addRules(
int index, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy value) {
if (rulesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureRulesIsMutable();
rules_.add(index, value);
onChanged();
} else {
rulesBuilder_.addMessage(index, value);
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder addRules(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.add(builderForValue.build());
onChanged();
} else {
rulesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder addRules(
int index, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder builderForValue) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.add(index, builderForValue.build());
onChanged();
} else {
rulesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder addAllRules(
java.lang.Iterable extends org.hyperledger.fabric.protos.common.Policies.SignaturePolicy> values) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, rules_);
onChanged();
} else {
rulesBuilder_.addAllMessages(values);
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder clearRules() {
if (rulesBuilder_ == null) {
rules_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
rulesBuilder_.clear();
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public Builder removeRules(int index) {
if (rulesBuilder_ == null) {
ensureRulesIsMutable();
rules_.remove(index);
onChanged();
} else {
rulesBuilder_.remove(index);
}
return this;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder getRulesBuilder(
int index) {
return getRulesFieldBuilder().getBuilder(index);
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRulesOrBuilder(
int index) {
if (rulesBuilder_ == null) {
return rules_.get(index); } else {
return rulesBuilder_.getMessageOrBuilder(index);
}
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public java.util.List extends org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>
getRulesOrBuilderList() {
if (rulesBuilder_ != null) {
return rulesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(rules_);
}
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder addRulesBuilder() {
return getRulesFieldBuilder().addBuilder(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance());
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder addRulesBuilder(
int index) {
return getRulesFieldBuilder().addBuilder(
index, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance());
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public java.util.List
getRulesBuilderList() {
return getRulesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>
getRulesFieldBuilder() {
if (rulesBuilder_ == null) {
rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder>(
rules_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
rules_ = null;
}
return rulesBuilder_;
}
@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:common.SignaturePolicy.NOutOf)
}
// @@protoc_insertion_point(class_scope:common.SignaturePolicy.NOutOf)
private static final org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf();
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public NOutOf parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int typeCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object type_;
public enum TypeCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
SIGNED_BY(1),
N_OUT_OF(2),
TYPE_NOT_SET(0);
private final int value;
private TypeCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static TypeCase valueOf(int value) {
return forNumber(value);
}
public static TypeCase forNumber(int value) {
switch (value) {
case 1: return SIGNED_BY;
case 2: return N_OUT_OF;
case 0: return TYPE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public TypeCase
getTypeCase() {
return TypeCase.forNumber(
typeCase_);
}
public static final int SIGNED_BY_FIELD_NUMBER = 1;
/**
* int32 signed_by = 1;
* @return Whether the signedBy field is set.
*/
@java.lang.Override
public boolean hasSignedBy() {
return typeCase_ == 1;
}
/**
* int32 signed_by = 1;
* @return The signedBy.
*/
@java.lang.Override
public int getSignedBy() {
if (typeCase_ == 1) {
return (java.lang.Integer) type_;
}
return 0;
}
public static final int N_OUT_OF_FIELD_NUMBER = 2;
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return Whether the nOutOf field is set.
*/
@java.lang.Override
public boolean hasNOutOf() {
return typeCase_ == 2;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return The nOutOf.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getNOutOf() {
if (typeCase_ == 2) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder getNOutOfOrBuilder() {
if (typeCase_ == 2) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
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 (typeCase_ == 1) {
output.writeInt32(
1, (int)((java.lang.Integer) type_));
}
if (typeCase_ == 2) {
output.writeMessage(2, (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (typeCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(
1, (int)((java.lang.Integer) type_));
}
if (typeCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.SignaturePolicy)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy other = (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy) obj;
if (!getTypeCase().equals(other.getTypeCase())) return false;
switch (typeCase_) {
case 1:
if (getSignedBy()
!= other.getSignedBy()) return false;
break;
case 2:
if (!getNOutOf()
.equals(other.getNOutOf())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (typeCase_) {
case 1:
hash = (37 * hash) + SIGNED_BY_FIELD_NUMBER;
hash = (53 * hash) + getSignedBy();
break;
case 2:
hash = (37 * hash) + N_OUT_OF_FIELD_NUMBER;
hash = (53 * hash) + getNOutOf().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy 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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy 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(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy 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;
}
/**
*
* SignaturePolicy is a recursive message structure which defines a featherweight DSL for describing
* policies which are more complicated than 'exactly this signature'. The NOutOf operator is sufficent
* to express AND as well as OR, as well as of course N out of the following M policies
* SignedBy implies that the signature is from a valid certificate which is signed by the trusted
* authority specified in the bytes. This will be the certificate itself for a self-signed certificate
* and will be the CA for more traditional certificates
*
*
* Protobuf type {@code common.SignaturePolicy}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.SignaturePolicy)
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.class, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (nOutOfBuilder_ != null) {
nOutOfBuilder_.clear();
}
typeCase_ = 0;
type_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy build() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy buildPartial() {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy result = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicy(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy result) {
result.typeCase_ = typeCase_;
result.type_ = this.type_;
if (typeCase_ == 2 &&
nOutOfBuilder_ != null) {
result.type_ = nOutOfBuilder_.build();
}
}
@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 org.hyperledger.fabric.protos.common.Policies.SignaturePolicy) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.SignaturePolicy)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy other) {
if (other == org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.getDefaultInstance()) return this;
switch (other.getTypeCase()) {
case SIGNED_BY: {
setSignedBy(other.getSignedBy());
break;
}
case N_OUT_OF: {
mergeNOutOf(other.getNOutOf());
break;
}
case TYPE_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
type_ = input.readInt32();
typeCase_ = 1;
break;
} // case 8
case 18: {
input.readMessage(
getNOutOfFieldBuilder().getBuilder(),
extensionRegistry);
typeCase_ = 2;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int typeCase_ = 0;
private java.lang.Object type_;
public TypeCase
getTypeCase() {
return TypeCase.forNumber(
typeCase_);
}
public Builder clearType() {
typeCase_ = 0;
type_ = null;
onChanged();
return this;
}
private int bitField0_;
/**
* int32 signed_by = 1;
* @return Whether the signedBy field is set.
*/
public boolean hasSignedBy() {
return typeCase_ == 1;
}
/**
* int32 signed_by = 1;
* @return The signedBy.
*/
public int getSignedBy() {
if (typeCase_ == 1) {
return (java.lang.Integer) type_;
}
return 0;
}
/**
* int32 signed_by = 1;
* @param value The signedBy to set.
* @return This builder for chaining.
*/
public Builder setSignedBy(int value) {
typeCase_ = 1;
type_ = value;
onChanged();
return this;
}
/**
* int32 signed_by = 1;
* @return This builder for chaining.
*/
public Builder clearSignedBy() {
if (typeCase_ == 1) {
typeCase_ = 0;
type_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder> nOutOfBuilder_;
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return Whether the nOutOf field is set.
*/
@java.lang.Override
public boolean hasNOutOf() {
return typeCase_ == 2;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
* @return The nOutOf.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getNOutOf() {
if (nOutOfBuilder_ == null) {
if (typeCase_ == 2) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
} else {
if (typeCase_ == 2) {
return nOutOfBuilder_.getMessage();
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
public Builder setNOutOf(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf value) {
if (nOutOfBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
} else {
nOutOfBuilder_.setMessage(value);
}
typeCase_ = 2;
return this;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
public Builder setNOutOf(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder builderForValue) {
if (nOutOfBuilder_ == null) {
type_ = builderForValue.build();
onChanged();
} else {
nOutOfBuilder_.setMessage(builderForValue.build());
}
typeCase_ = 2;
return this;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
public Builder mergeNOutOf(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf value) {
if (nOutOfBuilder_ == null) {
if (typeCase_ == 2 &&
type_ != org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance()) {
type_ = org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.newBuilder((org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_)
.mergeFrom(value).buildPartial();
} else {
type_ = value;
}
onChanged();
} else {
if (typeCase_ == 2) {
nOutOfBuilder_.mergeFrom(value);
} else {
nOutOfBuilder_.setMessage(value);
}
}
typeCase_ = 2;
return this;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
public Builder clearNOutOf() {
if (nOutOfBuilder_ == null) {
if (typeCase_ == 2) {
typeCase_ = 0;
type_ = null;
onChanged();
}
} else {
if (typeCase_ == 2) {
typeCase_ = 0;
type_ = null;
}
nOutOfBuilder_.clear();
}
return this;
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder getNOutOfBuilder() {
return getNOutOfFieldBuilder().getBuilder();
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder getNOutOfOrBuilder() {
if ((typeCase_ == 2) && (nOutOfBuilder_ != null)) {
return nOutOfBuilder_.getMessageOrBuilder();
} else {
if (typeCase_ == 2) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
}
/**
* .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder>
getNOutOfFieldBuilder() {
if (nOutOfBuilder_ == null) {
if (!(typeCase_ == 2)) {
type_ = org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
nOutOfBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOfOrBuilder>(
(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_,
getParentForChildren(),
isClean());
type_ = null;
}
typeCase_ = 2;
onChanged();
return nOutOfBuilder_;
}
@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:common.SignaturePolicy)
}
// @@protoc_insertion_point(class_scope:common.SignaturePolicy)
private static final org.hyperledger.fabric.protos.common.Policies.SignaturePolicy DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.SignaturePolicy();
}
public static org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public SignaturePolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface ImplicitMetaPolicyOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.ImplicitMetaPolicy)
com.google.protobuf.MessageOrBuilder {
/**
* string sub_policy = 1;
* @return The subPolicy.
*/
java.lang.String getSubPolicy();
/**
* string sub_policy = 1;
* @return The bytes for subPolicy.
*/
com.google.protobuf.ByteString
getSubPolicyBytes();
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The enum numeric value on the wire for rule.
*/
int getRuleValue();
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The rule.
*/
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule getRule();
}
/**
*
* ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration
* It is implicit because the rule is generate implicitly based on the number of sub policies
* It is meta because it depends only on the result of other policies
* When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy
* of name sub_policy, evaluates the collection and applies the rule.
* For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves
* each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY
* 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures.
*
*
* Protobuf type {@code common.ImplicitMetaPolicy}
*/
public static final class ImplicitMetaPolicy extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.ImplicitMetaPolicy)
ImplicitMetaPolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use ImplicitMetaPolicy.newBuilder() to construct.
private ImplicitMetaPolicy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ImplicitMetaPolicy() {
subPolicy_ = "";
rule_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ImplicitMetaPolicy();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.class, org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Builder.class);
}
/**
* Protobuf enum {@code common.ImplicitMetaPolicy.Rule}
*/
public enum Rule
implements com.google.protobuf.ProtocolMessageEnum {
/**
*
* Requires any of the sub-policies be satisfied, if no sub-policies exist, always returns true
*
*
* ANY = 0;
*/
ANY(0),
/**
*
* Requires all of the sub-policies be satisfied
*
*
* ALL = 1;
*/
ALL(1),
/**
*
* Requires a strict majority (greater than half) of the sub-policies be satisfied
*
*
* MAJORITY = 2;
*/
MAJORITY(2),
UNRECOGNIZED(-1),
;
/**
*
* Requires any of the sub-policies be satisfied, if no sub-policies exist, always returns true
*
*
* ANY = 0;
*/
public static final int ANY_VALUE = 0;
/**
*
* Requires all of the sub-policies be satisfied
*
*
* ALL = 1;
*/
public static final int ALL_VALUE = 1;
/**
*
* Requires a strict majority (greater than half) of the sub-policies be satisfied
*
*
* MAJORITY = 2;
*/
public static final int MAJORITY_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Rule valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Rule forNumber(int value) {
switch (value) {
case 0: return ANY;
case 1: return ALL;
case 2: return MAJORITY;
default: return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap
internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap<
Rule> internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Rule findValueByNumber(int number) {
return Rule.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor
getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.getDescriptor().getEnumTypes().get(0);
}
private static final Rule[] VALUES = values();
public static Rule valueOf(
com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException(
"EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Rule(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:common.ImplicitMetaPolicy.Rule)
}
public static final int SUB_POLICY_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object subPolicy_ = "";
/**
* string sub_policy = 1;
* @return The subPolicy.
*/
@java.lang.Override
public java.lang.String getSubPolicy() {
java.lang.Object ref = subPolicy_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
subPolicy_ = s;
return s;
}
}
/**
* string sub_policy = 1;
* @return The bytes for subPolicy.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getSubPolicyBytes() {
java.lang.Object ref = subPolicy_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
subPolicy_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RULE_FIELD_NUMBER = 2;
private int rule_ = 0;
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The enum numeric value on the wire for rule.
*/
@java.lang.Override public int getRuleValue() {
return rule_;
}
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The rule.
*/
@java.lang.Override public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule getRule() {
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule result = org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.forNumber(rule_);
return result == null ? org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.UNRECOGNIZED : result;
}
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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subPolicy_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subPolicy_);
}
if (rule_ != org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.ANY.getNumber()) {
output.writeEnum(2, rule_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(subPolicy_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subPolicy_);
}
if (rule_ != org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.ANY.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(2, rule_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy other = (org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy) obj;
if (!getSubPolicy()
.equals(other.getSubPolicy())) return false;
if (rule_ != other.rule_) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + SUB_POLICY_FIELD_NUMBER;
hash = (53 * hash) + getSubPolicy().hashCode();
hash = (37 * hash) + RULE_FIELD_NUMBER;
hash = (53 * hash) + rule_;
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy 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 org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy 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 org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy 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(org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy 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;
}
/**
*
* ImplicitMetaPolicy is a policy type which depends on the hierarchical nature of the configuration
* It is implicit because the rule is generate implicitly based on the number of sub policies
* It is meta because it depends only on the result of other policies
* When evaluated, this policy iterates over all immediate child sub-groups, retrieves the policy
* of name sub_policy, evaluates the collection and applies the rule.
* For example, with 4 sub-groups, and a policy name of "foo", ImplicitMetaPolicy retrieves
* each sub-group, retrieves policy "foo" for each subgroup, evaluates it, and, in the case of ANY
* 1 satisfied is sufficient, ALL would require 4 signatures, and MAJORITY would require 3 signatures.
*
*
* Protobuf type {@code common.ImplicitMetaPolicy}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.ImplicitMetaPolicy)
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.class, org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
subPolicy_ = "";
rule_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy build() {
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy buildPartial() {
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy result = new org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy(this);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.subPolicy_ = subPolicy_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.rule_ = rule_;
}
}
@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 org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy other) {
if (other == org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.getDefaultInstance()) return this;
if (!other.getSubPolicy().isEmpty()) {
subPolicy_ = other.subPolicy_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.rule_ != 0) {
setRuleValue(other.getRuleValue());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
subPolicy_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16: {
rule_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 16
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object subPolicy_ = "";
/**
* string sub_policy = 1;
* @return The subPolicy.
*/
public java.lang.String getSubPolicy() {
java.lang.Object ref = subPolicy_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
subPolicy_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string sub_policy = 1;
* @return The bytes for subPolicy.
*/
public com.google.protobuf.ByteString
getSubPolicyBytes() {
java.lang.Object ref = subPolicy_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
subPolicy_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string sub_policy = 1;
* @param value The subPolicy to set.
* @return This builder for chaining.
*/
public Builder setSubPolicy(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
subPolicy_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
* string sub_policy = 1;
* @return This builder for chaining.
*/
public Builder clearSubPolicy() {
subPolicy_ = getDefaultInstance().getSubPolicy();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
* string sub_policy = 1;
* @param value The bytes for subPolicy to set.
* @return This builder for chaining.
*/
public Builder setSubPolicyBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
subPolicy_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private int rule_ = 0;
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The enum numeric value on the wire for rule.
*/
@java.lang.Override public int getRuleValue() {
return rule_;
}
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @param value The enum numeric value on the wire for rule to set.
* @return This builder for chaining.
*/
public Builder setRuleValue(int value) {
rule_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return The rule.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule getRule() {
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule result = org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.forNumber(rule_);
return result == null ? org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.UNRECOGNIZED : result;
}
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @param value The rule to set.
* @return This builder for chaining.
*/
public Builder setRule(org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
rule_ = value.getNumber();
onChanged();
return this;
}
/**
* .common.ImplicitMetaPolicy.Rule rule = 2;
* @return This builder for chaining.
*/
public Builder clearRule() {
bitField0_ = (bitField0_ & ~0x00000002);
rule_ = 0;
onChanged();
return this;
}
@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:common.ImplicitMetaPolicy)
}
// @@protoc_insertion_point(class_scope:common.ImplicitMetaPolicy)
private static final org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy();
}
public static org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ImplicitMetaPolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
@java.lang.Deprecated public interface ApplicationPolicyOrBuilder extends
// @@protoc_insertion_point(interface_extends:common.ApplicationPolicy)
com.google.protobuf.MessageOrBuilder {
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return Whether the signaturePolicy field is set.
*/
boolean hasSignaturePolicy();
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return The signaturePolicy.
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getSignaturePolicy();
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder getSignaturePolicyOrBuilder();
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return Whether the channelConfigPolicyReference field is set.
*/
boolean hasChannelConfigPolicyReference();
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The channelConfigPolicyReference.
*/
java.lang.String getChannelConfigPolicyReference();
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The bytes for channelConfigPolicyReference.
*/
com.google.protobuf.ByteString
getChannelConfigPolicyReferenceBytes();
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.TypeCase getTypeCase();
}
/**
*
* ApplicationPolicy captures the diffenrent policy types that
* are set and evaluted at the application level.
*
*
* Protobuf type {@code common.ApplicationPolicy}
*/
@java.lang.Deprecated public static final class ApplicationPolicy extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:common.ApplicationPolicy)
ApplicationPolicyOrBuilder {
private static final long serialVersionUID = 0L;
// Use ApplicationPolicy.newBuilder() to construct.
private ApplicationPolicy(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ApplicationPolicy() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new ApplicationPolicy();
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ApplicationPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ApplicationPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.class, org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.Builder.class);
}
private int typeCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object type_;
public enum TypeCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
SIGNATURE_POLICY(1),
CHANNEL_CONFIG_POLICY_REFERENCE(2),
TYPE_NOT_SET(0);
private final int value;
private TypeCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static TypeCase valueOf(int value) {
return forNumber(value);
}
public static TypeCase forNumber(int value) {
switch (value) {
case 1: return SIGNATURE_POLICY;
case 2: return CHANNEL_CONFIG_POLICY_REFERENCE;
case 0: return TYPE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public TypeCase
getTypeCase() {
return TypeCase.forNumber(
typeCase_);
}
public static final int SIGNATURE_POLICY_FIELD_NUMBER = 1;
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return Whether the signaturePolicy field is set.
*/
@java.lang.Override
public boolean hasSignaturePolicy() {
return typeCase_ == 1;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return The signaturePolicy.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getSignaturePolicy() {
if (typeCase_ == 1) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder getSignaturePolicyOrBuilder() {
if (typeCase_ == 1) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
public static final int CHANNEL_CONFIG_POLICY_REFERENCE_FIELD_NUMBER = 2;
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return Whether the channelConfigPolicyReference field is set.
*/
public boolean hasChannelConfigPolicyReference() {
return typeCase_ == 2;
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The channelConfigPolicyReference.
*/
public java.lang.String getChannelConfigPolicyReference() {
java.lang.Object ref = "";
if (typeCase_ == 2) {
ref = type_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (typeCase_ == 2) {
type_ = s;
}
return s;
}
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The bytes for channelConfigPolicyReference.
*/
public com.google.protobuf.ByteString
getChannelConfigPolicyReferenceBytes() {
java.lang.Object ref = "";
if (typeCase_ == 2) {
ref = type_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (typeCase_ == 2) {
type_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 (typeCase_ == 1) {
output.writeMessage(1, (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_);
}
if (typeCase_ == 2) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, type_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (typeCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_);
}
if (typeCase_ == 2) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, type_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy)) {
return super.equals(obj);
}
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy other = (org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy) obj;
if (!getTypeCase().equals(other.getTypeCase())) return false;
switch (typeCase_) {
case 1:
if (!getSignaturePolicy()
.equals(other.getSignaturePolicy())) return false;
break;
case 2:
if (!getChannelConfigPolicyReference()
.equals(other.getChannelConfigPolicyReference())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (typeCase_) {
case 1:
hash = (37 * hash) + SIGNATURE_POLICY_FIELD_NUMBER;
hash = (53 * hash) + getSignaturePolicy().hashCode();
break;
case 2:
hash = (37 * hash) + CHANNEL_CONFIG_POLICY_REFERENCE_FIELD_NUMBER;
hash = (53 * hash) + getChannelConfigPolicyReference().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy 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 org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy 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 org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy 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(org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy 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;
}
/**
*
* ApplicationPolicy captures the diffenrent policy types that
* are set and evaluted at the application level.
*
*
* Protobuf type {@code common.ApplicationPolicy}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:common.ApplicationPolicy)
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ApplicationPolicy_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ApplicationPolicy_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.class, org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.Builder.class);
}
// Construct using org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (signaturePolicyBuilder_ != null) {
signaturePolicyBuilder_.clear();
}
typeCase_ = 0;
type_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ApplicationPolicy_descriptor;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.getDefaultInstance();
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy build() {
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy buildPartial() {
org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy result = new org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy(this);
if (bitField0_ != 0) { buildPartial0(result); }
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy result) {
result.typeCase_ = typeCase_;
result.type_ = this.type_;
if (typeCase_ == 1 &&
signaturePolicyBuilder_ != null) {
result.type_ = signaturePolicyBuilder_.build();
}
}
@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 org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy) {
return mergeFrom((org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy other) {
if (other == org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy.getDefaultInstance()) return this;
switch (other.getTypeCase()) {
case SIGNATURE_POLICY: {
mergeSignaturePolicy(other.getSignaturePolicy());
break;
}
case CHANNEL_CONFIG_POLICY_REFERENCE: {
typeCase_ = 2;
type_ = other.type_;
onChanged();
break;
}
case TYPE_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
input.readMessage(
getSignaturePolicyFieldBuilder().getBuilder(),
extensionRegistry);
typeCase_ = 1;
break;
} // case 10
case 18: {
java.lang.String s = input.readStringRequireUtf8();
typeCase_ = 2;
type_ = s;
break;
} // case 18
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int typeCase_ = 0;
private java.lang.Object type_;
public TypeCase
getTypeCase() {
return TypeCase.forNumber(
typeCase_);
}
public Builder clearType() {
typeCase_ = 0;
type_ = null;
onChanged();
return this;
}
private int bitField0_;
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder> signaturePolicyBuilder_;
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return Whether the signaturePolicy field is set.
*/
@java.lang.Override
public boolean hasSignaturePolicy() {
return typeCase_ == 1;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
* @return The signaturePolicy.
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope getSignaturePolicy() {
if (signaturePolicyBuilder_ == null) {
if (typeCase_ == 1) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
} else {
if (typeCase_ == 1) {
return signaturePolicyBuilder_.getMessage();
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
public Builder setSignaturePolicy(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope value) {
if (signaturePolicyBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
onChanged();
} else {
signaturePolicyBuilder_.setMessage(value);
}
typeCase_ = 1;
return this;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
public Builder setSignaturePolicy(
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder builderForValue) {
if (signaturePolicyBuilder_ == null) {
type_ = builderForValue.build();
onChanged();
} else {
signaturePolicyBuilder_.setMessage(builderForValue.build());
}
typeCase_ = 1;
return this;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
public Builder mergeSignaturePolicy(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope value) {
if (signaturePolicyBuilder_ == null) {
if (typeCase_ == 1 &&
type_ != org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance()) {
type_ = org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.newBuilder((org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_)
.mergeFrom(value).buildPartial();
} else {
type_ = value;
}
onChanged();
} else {
if (typeCase_ == 1) {
signaturePolicyBuilder_.mergeFrom(value);
} else {
signaturePolicyBuilder_.setMessage(value);
}
}
typeCase_ = 1;
return this;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
public Builder clearSignaturePolicy() {
if (signaturePolicyBuilder_ == null) {
if (typeCase_ == 1) {
typeCase_ = 0;
type_ = null;
onChanged();
}
} else {
if (typeCase_ == 1) {
typeCase_ = 0;
type_ = null;
}
signaturePolicyBuilder_.clear();
}
return this;
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder getSignaturePolicyBuilder() {
return getSignaturePolicyFieldBuilder().getBuilder();
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder getSignaturePolicyOrBuilder() {
if ((typeCase_ == 1) && (signaturePolicyBuilder_ != null)) {
return signaturePolicyBuilder_.getMessageOrBuilder();
} else {
if (typeCase_ == 1) {
return (org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_;
}
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
}
/**
*
* SignaturePolicy type is used if the policy is specified as
* a combination (using threshold gates) of signatures from MSP
* principals
*
*
* .common.SignaturePolicyEnvelope signature_policy = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder>
getSignaturePolicyFieldBuilder() {
if (signaturePolicyBuilder_ == null) {
if (!(typeCase_ == 1)) {
type_ = org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.getDefaultInstance();
}
signaturePolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope.Builder, org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelopeOrBuilder>(
(org.hyperledger.fabric.protos.common.Policies.SignaturePolicyEnvelope) type_,
getParentForChildren(),
isClean());
type_ = null;
}
typeCase_ = 1;
onChanged();
return signaturePolicyBuilder_;
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return Whether the channelConfigPolicyReference field is set.
*/
@java.lang.Override
public boolean hasChannelConfigPolicyReference() {
return typeCase_ == 2;
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The channelConfigPolicyReference.
*/
@java.lang.Override
public java.lang.String getChannelConfigPolicyReference() {
java.lang.Object ref = "";
if (typeCase_ == 2) {
ref = type_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (typeCase_ == 2) {
type_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return The bytes for channelConfigPolicyReference.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getChannelConfigPolicyReferenceBytes() {
java.lang.Object ref = "";
if (typeCase_ == 2) {
ref = type_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (typeCase_ == 2) {
type_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @param value The channelConfigPolicyReference to set.
* @return This builder for chaining.
*/
public Builder setChannelConfigPolicyReference(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
typeCase_ = 2;
type_ = value;
onChanged();
return this;
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @return This builder for chaining.
*/
public Builder clearChannelConfigPolicyReference() {
if (typeCase_ == 2) {
typeCase_ = 0;
type_ = null;
onChanged();
}
return this;
}
/**
*
* ChannelConfigPolicyReference is used when the policy is
* specified as a string that references a policy defined in
* the configuration of the channel
*
*
* string channel_config_policy_reference = 2;
* @param value The bytes for channelConfigPolicyReference to set.
* @return This builder for chaining.
*/
public Builder setChannelConfigPolicyReferenceBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
typeCase_ = 2;
type_ = value;
onChanged();
return this;
}
@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:common.ApplicationPolicy)
}
// @@protoc_insertion_point(class_scope:common.ApplicationPolicy)
private static final org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy();
}
public static org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ApplicationPolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public org.hyperledger.fabric.protos.common.Policies.ApplicationPolicy getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_Policy_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_Policy_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_SignaturePolicyEnvelope_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_SignaturePolicyEnvelope_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_SignaturePolicy_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_SignaturePolicy_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_SignaturePolicy_NOutOf_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_SignaturePolicy_NOutOf_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_ImplicitMetaPolicy_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_ImplicitMetaPolicy_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_common_ApplicationPolicy_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_common_ApplicationPolicy_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\025common/policies.proto\022\006common\032\027msp/msp" +
"_principal.proto\"k\n\006Policy\022\014\n\004type\030\001 \001(\005" +
"\022\r\n\005value\030\002 \001(\014\"D\n\nPolicyType\022\013\n\007UNKNOWN" +
"\020\000\022\r\n\tSIGNATURE\020\001\022\007\n\003MSP\020\002\022\021\n\rIMPLICIT_M" +
"ETA\020\003\"{\n\027SignaturePolicyEnvelope\022\017\n\007vers" +
"ion\030\001 \001(\005\022%\n\004rule\030\002 \001(\0132\027.common.Signatu" +
"rePolicy\022(\n\nidentities\030\003 \003(\0132\024.common.MS" +
"PPrincipal\"\237\001\n\017SignaturePolicy\022\023\n\tsigned" +
"_by\030\001 \001(\005H\000\0222\n\010n_out_of\030\002 \001(\0132\036.common.S" +
"ignaturePolicy.NOutOfH\000\032;\n\006NOutOf\022\t\n\001n\030\001" +
" \001(\005\022&\n\005rules\030\002 \003(\0132\027.common.SignaturePo" +
"licyB\006\n\004Type\"\177\n\022ImplicitMetaPolicy\022\022\n\nsu" +
"b_policy\030\001 \001(\t\022-\n\004rule\030\002 \001(\0162\037.common.Im" +
"plicitMetaPolicy.Rule\"&\n\004Rule\022\007\n\003ANY\020\000\022\007" +
"\n\003ALL\020\001\022\014\n\010MAJORITY\020\002\"\207\001\n\021ApplicationPol" +
"icy\022;\n\020signature_policy\030\001 \001(\0132\037.common.S" +
"ignaturePolicyEnvelopeH\000\022)\n\037channel_conf" +
"ig_policy_reference\030\002 \001(\tH\000:\002\030\001B\006\n\004TypeB" +
"V\n$org.hyperledger.fabric.protos.commonZ" +
".github.com/hyperledger/fabric-protos-go" +
"/commonb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
org.hyperledger.fabric.protos.common.MspPrincipal.getDescriptor(),
});
internal_static_common_Policy_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_common_Policy_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_Policy_descriptor,
new java.lang.String[] { "Type", "Value", });
internal_static_common_SignaturePolicyEnvelope_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_common_SignaturePolicyEnvelope_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_SignaturePolicyEnvelope_descriptor,
new java.lang.String[] { "Version", "Rule", "Identities", });
internal_static_common_SignaturePolicy_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_common_SignaturePolicy_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_SignaturePolicy_descriptor,
new java.lang.String[] { "SignedBy", "NOutOf", "Type", });
internal_static_common_SignaturePolicy_NOutOf_descriptor =
internal_static_common_SignaturePolicy_descriptor.getNestedTypes().get(0);
internal_static_common_SignaturePolicy_NOutOf_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_SignaturePolicy_NOutOf_descriptor,
new java.lang.String[] { "N", "Rules", });
internal_static_common_ImplicitMetaPolicy_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_common_ImplicitMetaPolicy_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_ImplicitMetaPolicy_descriptor,
new java.lang.String[] { "SubPolicy", "Rule", });
internal_static_common_ApplicationPolicy_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_common_ApplicationPolicy_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_common_ApplicationPolicy_descriptor,
new java.lang.String[] { "SignaturePolicy", "ChannelConfigPolicyReference", "Type", });
org.hyperledger.fabric.protos.common.MspPrincipal.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy