Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// 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
*
*
* optional int32 type = 1;
*/
int getType();
/**
* optional bytes value = 2;
*/
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 {
// Use Policy.newBuilder() to construct.
private Policy(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private Policy() {
type_ = 0;
value_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Policy(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
type_ = input.readInt32();
break;
}
case 18: {
value_ = input.readBytes();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_descriptor;
}
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 {
/**
*
*
* 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;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static PolicyType valueOf(int value) {
return forNumber(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() {
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_;
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* optional int32 type = 1;
*/
public int getType() {
return type_;
}
public static final int VALUE_FIELD_NUMBER = 2;
private com.google.protobuf.ByteString value_;
/**
* optional bytes value = 2;
*/
public com.google.protobuf.ByteString getValue() {
return value_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
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_);
}
}
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_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@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;
boolean result = true;
result = result && (getType()
== other.getType());
result = result && getValue()
.equals(other.getValue());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().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) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
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);
}
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);
}
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;
}
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() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
type_ = 0;
value_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_Policy_descriptor;
}
public org.hyperledger.fabric.protos.common.Policies.Policy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.Policy.getDefaultInstance();
}
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;
}
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);
result.type_ = type_;
result.value_ = value_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
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());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.Policies.Policy parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.Policies.Policy) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int type_ ;
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
*
* optional int32 type = 1;
*/
public int getType() {
return type_;
}
/**
*
* For outside implementors, consider the first 1000 types reserved, otherwise one of PolicyType
*
* 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 {
// Use SignaturePolicy.newBuilder() to construct.
private SignaturePolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private SignaturePolicy() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private SignaturePolicy(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
typeCase_ = 1;
type_ = input.readInt32();
break;
}
case 18: {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.Builder subBuilder = null;
if (typeCase_ == 2) {
subBuilder = ((org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_).toBuilder();
}
type_ =
input.readMessage(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) type_);
type_ = subBuilder.buildPartial();
}
typeCase_ = 2;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_descriptor;
}
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 {
/**
* optional int32 n = 1;
*/
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
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 {
// Use NOutOf.newBuilder() to construct.
private NOutOf(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private NOutOf() {
n_ = 0;
rules_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private NOutOf(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
n_ = input.readInt32();
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
rules_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
rules_.add(
input.readMessage(org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.parser(), extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
rules_ = java.util.Collections.unmodifiableList(rules_);
}
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_descriptor;
}
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);
}
private int bitField0_;
public static final int N_FIELD_NUMBER = 1;
private int n_;
/**
* optional int32 n = 1;
*/
public int getN() {
return n_;
}
public static final int RULES_FIELD_NUMBER = 2;
private java.util.List rules_;
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public java.util.List getRulesList() {
return rules_;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public java.util.List
getRulesOrBuilderList() {
return rules_;
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public int getRulesCount() {
return rules_.size();
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy getRules(int index) {
return rules_.get(index);
}
/**
* repeated .common.SignaturePolicy rules = 2;
*/
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicyOrBuilder getRulesOrBuilder(
int index) {
return rules_.get(index);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
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));
}
}
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));
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@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;
boolean result = true;
result = result && (getN()
== other.getN());
result = result && getRulesList()
.equals(other.getRulesList());
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().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) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
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);
}
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);
}
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;
}
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() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getRulesFieldBuilder();
}
}
public Builder clear() {
super.clear();
n_ = 0;
if (rulesBuilder_ == null) {
rules_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
rulesBuilder_.clear();
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_SignaturePolicy_NOutOf_descriptor;
}
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf.getDefaultInstance();
}
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;
}
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);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.n_ = n_;
if (rulesBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
rules_ = java.util.Collections.unmodifiableList(rules_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.rules_ = rules_;
} else {
result.rules_ = rulesBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
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_);
}
}
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private int n_ ;
/**
* optional int32 n = 1;
*/
public int getN() {
return n_;
}
/**
* optional int32 n = 1;
*/
public Builder setN(int value) {
n_ = value;
onChanged();
return this;
}
/**
* optional int32 n = 1;
*/
public Builder clearN() {
n_ = 0;
onChanged();
return this;
}
private java.util.List rules_ =
java.util.Collections.emptyList();
private void ensureRulesIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
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 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
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) == 0x00000002),
getParentForChildren(),
isClean());
rules_ = null;
}
return rulesBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@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() {
public NOutOf parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new NOutOf(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.Policies.SignaturePolicy.NOutOf getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int typeCase_ = 0;
private java.lang.Object type_;
public enum TypeCase
implements com.google.protobuf.Internal.EnumLite {
SIGNED_BY(1),
N_OUT_OF(2),
TYPE_NOT_SET(0);
private final int value;
private TypeCase(int value) {
this.value = value;
}
/**
* @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;
/**
* optional int32 signed_by = 1;
*/
public int getSignedBy() {
if (typeCase_ == 1) {
return (java.lang.Integer) type_;
}
return 0;
}
public static final int N_OUT_OF_FIELD_NUMBER = 2;
/**
* optional .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
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();
}
/**
* optional .common.SignaturePolicy.NOutOf n_out_of = 2;
*/
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;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
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_);
}
}
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_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@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;
boolean result = true;
result = result && getTypeCase().equals(
other.getTypeCase());
if (!result) return false;
switch (typeCase_) {
case 1:
result = result && (getSignedBy()
== other.getSignedBy());
break;
case 2:
result = result && getNOutOf()
.equals(other.getNOutOf());
break;
case 0:
default:
}
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().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) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
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);
}
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);
}
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
*
* 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 {
// Use ImplicitMetaPolicy.newBuilder() to construct.
private ImplicitMetaPolicy(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private ImplicitMetaPolicy() {
subPolicy_ = "";
rule_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private ImplicitMetaPolicy(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
subPolicy_ = s;
break;
}
case 16: {
int rawValue = input.readEnum();
rule_ = rawValue;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_descriptor;
}
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
*
* 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;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Rule valueOf(int value) {
return forNumber(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() {
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;
private volatile java.lang.Object subPolicy_;
/**
* optional string sub_policy = 1;
*/
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;
}
}
/**
* optional string sub_policy = 1;
*/
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_;
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
public int getRuleValue() {
return rule_;
}
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
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.valueOf(rule_);
return result == null ? org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.UNRECOGNIZED : result;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getSubPolicyBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subPolicy_);
}
if (rule_ != org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.ANY.getNumber()) {
output.writeEnum(2, rule_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getSubPolicyBytes().isEmpty()) {
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_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@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;
boolean result = true;
result = result && getSubPolicy()
.equals(other.getSubPolicy());
result = result && rule_ == other.rule_;
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().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) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
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);
}
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);
}
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;
}
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() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
subPolicy_ = "";
rule_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.hyperledger.fabric.protos.common.Policies.internal_static_common_ImplicitMetaPolicy_descriptor;
}
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy getDefaultInstanceForType() {
return org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.getDefaultInstance();
}
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;
}
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);
result.subPolicy_ = subPolicy_;
result.rule_ = rule_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
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_;
onChanged();
}
if (other.rule_ != 0) {
setRuleValue(other.getRuleValue());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object subPolicy_ = "";
/**
* optional string sub_policy = 1;
*/
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;
}
}
/**
* optional string sub_policy = 1;
*/
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;
}
}
/**
* optional string sub_policy = 1;
*/
public Builder setSubPolicy(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
subPolicy_ = value;
onChanged();
return this;
}
/**
* optional string sub_policy = 1;
*/
public Builder clearSubPolicy() {
subPolicy_ = getDefaultInstance().getSubPolicy();
onChanged();
return this;
}
/**
* optional string sub_policy = 1;
*/
public Builder setSubPolicyBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
subPolicy_ = value;
onChanged();
return this;
}
private int rule_ = 0;
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
public int getRuleValue() {
return rule_;
}
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
public Builder setRuleValue(int value) {
rule_ = value;
onChanged();
return this;
}
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
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.valueOf(rule_);
return result == null ? org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule.UNRECOGNIZED : result;
}
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
public Builder setRule(org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy.Rule value) {
if (value == null) {
throw new NullPointerException();
}
rule_ = value.getNumber();
onChanged();
return this;
}
/**
* optional .common.ImplicitMetaPolicy.Rule rule = 2;
*/
public Builder clearRule() {
rule_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@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() {
public ImplicitMetaPolicy parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ImplicitMetaPolicy(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public org.hyperledger.fabric.protos.common.Policies.ImplicitMetaPolicy 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;
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\002BS\n$org.hyperledger" +
".fabric.protos.commonZ+github.com/hyperl" +
"edger/fabric/protos/commonb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
org.hyperledger.fabric.protos.common.MspPrincipal.getDescriptor(),
}, assigner);
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", });
org.hyperledger.fabric.protos.common.MspPrincipal.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}