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

com.hederahashgraph.api.proto.java.Key Maven / Gradle / Ivy

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

package com.hederahashgraph.api.proto.java;

/**
 * 
 * A Key can be a public key from one of the three supported systems (ed25519, RSA-3072,  ECDSA with p384). Or, it can be the ID of a smart contract instance, which is authorized to act as if it had a key. If an account has an ed25519 key associated with it, then the corresponding private key must sign any transaction to transfer cryptocurrency out of it. And similarly for RSA and ECDSA.
 * A Key can be a smart contract ID, which means that smart contract is to authorize operations as if it had signed with a key that it owned. The smart contract doesn't actually have a key, and  doesn't actually sign a transaction. But it's as if a virtual transaction were created, and the smart contract signed it with a private key.
 * A key can be a "threshold key", which means a list of M keys, any N of which must sign in order for the threshold signature to be considered valid. The keys within a threshold signature may themselves be threshold signatures, to allow complex signature requirements.
 * A Key can be a list of keys. Their use is dependent on context. For example, a Hedera file is created with a list of keys, where all of them must sign a transaction to create or modify the file, but only one of them is needed to sign a transaction to delete the file. So it's a single list that sometimes acts as a 1-of-M threshold key, and sometimes acts as an M-of-M threshold key.
 * A Key can contain a ThresholdKey or KeyList, which in turn contain a Key, so this mutual recursion would allow nesting arbitrarily deep. A ThresholdKey which contains a list of primitive keys (e.g., ed25519) has 3 levels: ThresholdKey -> KeyList -> Key. A KeyList which contains several primitive keys (e.g., ed25519) has 2 levels: KeyList -> Key. A Key with 2 levels of nested ThresholdKeys has 7 levels: Key -> ThresholdKey -> KeyList -> Key -> ThresholdKey -> KeyList -> Key.
 * Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys.
 * 
* * Protobuf type {@code proto.Key} */ public final class Key extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:proto.Key) KeyOrBuilder { private static final long serialVersionUID = 0L; // Use Key.newBuilder() to construct. private Key(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Key() { } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Key( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { com.hederahashgraph.api.proto.java.ContractID.Builder subBuilder = null; if (keyCase_ == 1) { subBuilder = ((com.hederahashgraph.api.proto.java.ContractID) key_).toBuilder(); } key_ = input.readMessage(com.hederahashgraph.api.proto.java.ContractID.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.hederahashgraph.api.proto.java.ContractID) key_); key_ = subBuilder.buildPartial(); } keyCase_ = 1; break; } case 18: { keyCase_ = 2; key_ = input.readBytes(); break; } case 26: { keyCase_ = 3; key_ = input.readBytes(); break; } case 34: { keyCase_ = 4; key_ = input.readBytes(); break; } case 42: { com.hederahashgraph.api.proto.java.ThresholdKey.Builder subBuilder = null; if (keyCase_ == 5) { subBuilder = ((com.hederahashgraph.api.proto.java.ThresholdKey) key_).toBuilder(); } key_ = input.readMessage(com.hederahashgraph.api.proto.java.ThresholdKey.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.hederahashgraph.api.proto.java.ThresholdKey) key_); key_ = subBuilder.buildPartial(); } keyCase_ = 5; break; } case 50: { com.hederahashgraph.api.proto.java.KeyList.Builder subBuilder = null; if (keyCase_ == 6) { subBuilder = ((com.hederahashgraph.api.proto.java.KeyList) key_).toBuilder(); } key_ = input.readMessage(com.hederahashgraph.api.proto.java.KeyList.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.hederahashgraph.api.proto.java.KeyList) key_); key_ = subBuilder.buildPartial(); } keyCase_ = 6; 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 { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.hederahashgraph.api.proto.java.BasicTypes.internal_static_proto_Key_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.hederahashgraph.api.proto.java.BasicTypes.internal_static_proto_Key_fieldAccessorTable .ensureFieldAccessorsInitialized( com.hederahashgraph.api.proto.java.Key.class, com.hederahashgraph.api.proto.java.Key.Builder.class); } private int keyCase_ = 0; private java.lang.Object key_; public enum KeyCase implements com.google.protobuf.Internal.EnumLite { CONTRACTID(1), ED25519(2), RSA_3072(3), ECDSA_384(4), THRESHOLDKEY(5), KEYLIST(6), KEY_NOT_SET(0); private final int value; private KeyCase(int value) { this.value = value; } /** * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static KeyCase valueOf(int value) { return forNumber(value); } public static KeyCase forNumber(int value) { switch (value) { case 1: return CONTRACTID; case 2: return ED25519; case 3: return RSA_3072; case 4: return ECDSA_384; case 5: return THRESHOLDKEY; case 6: return KEYLIST; case 0: return KEY_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public KeyCase getKeyCase() { return KeyCase.forNumber( keyCase_); } public static final int CONTRACTID_FIELD_NUMBER = 1; /** *
   * smart contract instance that is authorized as if it had signed with a key
   * 
* * .proto.ContractID contractID = 1; */ public boolean hasContractID() { return keyCase_ == 1; } /** *
   * smart contract instance that is authorized as if it had signed with a key
   * 
* * .proto.ContractID contractID = 1; */ public com.hederahashgraph.api.proto.java.ContractID getContractID() { if (keyCase_ == 1) { return (com.hederahashgraph.api.proto.java.ContractID) key_; } return com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } /** *
   * smart contract instance that is authorized as if it had signed with a key
   * 
* * .proto.ContractID contractID = 1; */ public com.hederahashgraph.api.proto.java.ContractIDOrBuilder getContractIDOrBuilder() { if (keyCase_ == 1) { return (com.hederahashgraph.api.proto.java.ContractID) key_; } return com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } public static final int ED25519_FIELD_NUMBER = 2; /** *
   * ed25519 public key bytes
   * 
* * bytes ed25519 = 2; */ public com.google.protobuf.ByteString getEd25519() { if (keyCase_ == 2) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } public static final int RSA_3072_FIELD_NUMBER = 3; /** *
   *RSA-3072 public key bytes
   * 
* * bytes RSA_3072 = 3; */ public com.google.protobuf.ByteString getRSA3072() { if (keyCase_ == 3) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } public static final int ECDSA_384_FIELD_NUMBER = 4; /** *
   *ECDSA with the p-384 curve public key bytes
   * 
* * bytes ECDSA_384 = 4; */ public com.google.protobuf.ByteString getECDSA384() { if (keyCase_ == 4) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } public static final int THRESHOLDKEY_FIELD_NUMBER = 5; /** *
   * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
   * 
* * .proto.ThresholdKey thresholdKey = 5; */ public boolean hasThresholdKey() { return keyCase_ == 5; } /** *
   * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
   * 
* * .proto.ThresholdKey thresholdKey = 5; */ public com.hederahashgraph.api.proto.java.ThresholdKey getThresholdKey() { if (keyCase_ == 5) { return (com.hederahashgraph.api.proto.java.ThresholdKey) key_; } return com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } /** *
   * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
   * 
* * .proto.ThresholdKey thresholdKey = 5; */ public com.hederahashgraph.api.proto.java.ThresholdKeyOrBuilder getThresholdKeyOrBuilder() { if (keyCase_ == 5) { return (com.hederahashgraph.api.proto.java.ThresholdKey) key_; } return com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } public static final int KEYLIST_FIELD_NUMBER = 6; /** *
   * A list of Keys of the Key type.
   * 
* * .proto.KeyList keyList = 6; */ public boolean hasKeyList() { return keyCase_ == 6; } /** *
   * A list of Keys of the Key type.
   * 
* * .proto.KeyList keyList = 6; */ public com.hederahashgraph.api.proto.java.KeyList getKeyList() { if (keyCase_ == 6) { return (com.hederahashgraph.api.proto.java.KeyList) key_; } return com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance(); } /** *
   * A list of Keys of the Key type.
   * 
* * .proto.KeyList keyList = 6; */ public com.hederahashgraph.api.proto.java.KeyListOrBuilder getKeyListOrBuilder() { if (keyCase_ == 6) { return (com.hederahashgraph.api.proto.java.KeyList) key_; } return com.hederahashgraph.api.proto.java.KeyList.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 (keyCase_ == 1) { output.writeMessage(1, (com.hederahashgraph.api.proto.java.ContractID) key_); } if (keyCase_ == 2) { output.writeBytes( 2, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 3) { output.writeBytes( 3, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 4) { output.writeBytes( 4, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 5) { output.writeMessage(5, (com.hederahashgraph.api.proto.java.ThresholdKey) key_); } if (keyCase_ == 6) { output.writeMessage(6, (com.hederahashgraph.api.proto.java.KeyList) key_); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (keyCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, (com.hederahashgraph.api.proto.java.ContractID) key_); } if (keyCase_ == 2) { size += com.google.protobuf.CodedOutputStream .computeBytesSize( 2, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 3) { size += com.google.protobuf.CodedOutputStream .computeBytesSize( 3, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 4) { size += com.google.protobuf.CodedOutputStream .computeBytesSize( 4, (com.google.protobuf.ByteString) key_); } if (keyCase_ == 5) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, (com.hederahashgraph.api.proto.java.ThresholdKey) key_); } if (keyCase_ == 6) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(6, (com.hederahashgraph.api.proto.java.KeyList) key_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.hederahashgraph.api.proto.java.Key)) { return super.equals(obj); } com.hederahashgraph.api.proto.java.Key other = (com.hederahashgraph.api.proto.java.Key) obj; boolean result = true; result = result && getKeyCase().equals( other.getKeyCase()); if (!result) return false; switch (keyCase_) { case 1: result = result && getContractID() .equals(other.getContractID()); break; case 2: result = result && getEd25519() .equals(other.getEd25519()); break; case 3: result = result && getRSA3072() .equals(other.getRSA3072()); break; case 4: result = result && getECDSA384() .equals(other.getECDSA384()); break; case 5: result = result && getThresholdKey() .equals(other.getThresholdKey()); break; case 6: result = result && getKeyList() .equals(other.getKeyList()); break; case 0: default: } result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); switch (keyCase_) { case 1: hash = (37 * hash) + CONTRACTID_FIELD_NUMBER; hash = (53 * hash) + getContractID().hashCode(); break; case 2: hash = (37 * hash) + ED25519_FIELD_NUMBER; hash = (53 * hash) + getEd25519().hashCode(); break; case 3: hash = (37 * hash) + RSA_3072_FIELD_NUMBER; hash = (53 * hash) + getRSA3072().hashCode(); break; case 4: hash = (37 * hash) + ECDSA_384_FIELD_NUMBER; hash = (53 * hash) + getECDSA384().hashCode(); break; case 5: hash = (37 * hash) + THRESHOLDKEY_FIELD_NUMBER; hash = (53 * hash) + getThresholdKey().hashCode(); break; case 6: hash = (37 * hash) + KEYLIST_FIELD_NUMBER; hash = (53 * hash) + getKeyList().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.hederahashgraph.api.proto.java.Key parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.hederahashgraph.api.proto.java.Key parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.hederahashgraph.api.proto.java.Key parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.hederahashgraph.api.proto.java.Key parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.hederahashgraph.api.proto.java.Key parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.hederahashgraph.api.proto.java.Key parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.hederahashgraph.api.proto.java.Key parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.hederahashgraph.api.proto.java.Key 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 com.hederahashgraph.api.proto.java.Key parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.hederahashgraph.api.proto.java.Key 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 com.hederahashgraph.api.proto.java.Key parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.hederahashgraph.api.proto.java.Key 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(com.hederahashgraph.api.proto.java.Key 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; } /** *
   * A Key can be a public key from one of the three supported systems (ed25519, RSA-3072,  ECDSA with p384). Or, it can be the ID of a smart contract instance, which is authorized to act as if it had a key. If an account has an ed25519 key associated with it, then the corresponding private key must sign any transaction to transfer cryptocurrency out of it. And similarly for RSA and ECDSA.
   * A Key can be a smart contract ID, which means that smart contract is to authorize operations as if it had signed with a key that it owned. The smart contract doesn't actually have a key, and  doesn't actually sign a transaction. But it's as if a virtual transaction were created, and the smart contract signed it with a private key.
   * A key can be a "threshold key", which means a list of M keys, any N of which must sign in order for the threshold signature to be considered valid. The keys within a threshold signature may themselves be threshold signatures, to allow complex signature requirements.
   * A Key can be a list of keys. Their use is dependent on context. For example, a Hedera file is created with a list of keys, where all of them must sign a transaction to create or modify the file, but only one of them is needed to sign a transaction to delete the file. So it's a single list that sometimes acts as a 1-of-M threshold key, and sometimes acts as an M-of-M threshold key.
   * A Key can contain a ThresholdKey or KeyList, which in turn contain a Key, so this mutual recursion would allow nesting arbitrarily deep. A ThresholdKey which contains a list of primitive keys (e.g., ed25519) has 3 levels: ThresholdKey -> KeyList -> Key. A KeyList which contains several primitive keys (e.g., ed25519) has 2 levels: KeyList -> Key. A Key with 2 levels of nested ThresholdKeys has 7 levels: Key -> ThresholdKey -> KeyList -> Key -> ThresholdKey -> KeyList -> Key.
   * Each Key should not have more than 46 levels, which implies 15 levels of nested ThresholdKeys.
   * 
* * Protobuf type {@code proto.Key} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:proto.Key) com.hederahashgraph.api.proto.java.KeyOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.hederahashgraph.api.proto.java.BasicTypes.internal_static_proto_Key_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.hederahashgraph.api.proto.java.BasicTypes.internal_static_proto_Key_fieldAccessorTable .ensureFieldAccessorsInitialized( com.hederahashgraph.api.proto.java.Key.class, com.hederahashgraph.api.proto.java.Key.Builder.class); } // Construct using com.hederahashgraph.api.proto.java.Key.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(); keyCase_ = 0; key_ = null; return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.hederahashgraph.api.proto.java.BasicTypes.internal_static_proto_Key_descriptor; } public com.hederahashgraph.api.proto.java.Key getDefaultInstanceForType() { return com.hederahashgraph.api.proto.java.Key.getDefaultInstance(); } public com.hederahashgraph.api.proto.java.Key build() { com.hederahashgraph.api.proto.java.Key result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.hederahashgraph.api.proto.java.Key buildPartial() { com.hederahashgraph.api.proto.java.Key result = new com.hederahashgraph.api.proto.java.Key(this); if (keyCase_ == 1) { if (contractIDBuilder_ == null) { result.key_ = key_; } else { result.key_ = contractIDBuilder_.build(); } } if (keyCase_ == 2) { result.key_ = key_; } if (keyCase_ == 3) { result.key_ = key_; } if (keyCase_ == 4) { result.key_ = key_; } if (keyCase_ == 5) { if (thresholdKeyBuilder_ == null) { result.key_ = key_; } else { result.key_ = thresholdKeyBuilder_.build(); } } if (keyCase_ == 6) { if (keyListBuilder_ == null) { result.key_ = key_; } else { result.key_ = keyListBuilder_.build(); } } result.keyCase_ = keyCase_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.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, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.hederahashgraph.api.proto.java.Key) { return mergeFrom((com.hederahashgraph.api.proto.java.Key)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.hederahashgraph.api.proto.java.Key other) { if (other == com.hederahashgraph.api.proto.java.Key.getDefaultInstance()) return this; switch (other.getKeyCase()) { case CONTRACTID: { mergeContractID(other.getContractID()); break; } case ED25519: { setEd25519(other.getEd25519()); break; } case RSA_3072: { setRSA3072(other.getRSA3072()); break; } case ECDSA_384: { setECDSA384(other.getECDSA384()); break; } case THRESHOLDKEY: { mergeThresholdKey(other.getThresholdKey()); break; } case KEYLIST: { mergeKeyList(other.getKeyList()); break; } case KEY_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); 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 { com.hederahashgraph.api.proto.java.Key parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.hederahashgraph.api.proto.java.Key) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int keyCase_ = 0; private java.lang.Object key_; public KeyCase getKeyCase() { return KeyCase.forNumber( keyCase_); } public Builder clearKey() { keyCase_ = 0; key_ = null; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ContractID, com.hederahashgraph.api.proto.java.ContractID.Builder, com.hederahashgraph.api.proto.java.ContractIDOrBuilder> contractIDBuilder_; /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public boolean hasContractID() { return keyCase_ == 1; } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public com.hederahashgraph.api.proto.java.ContractID getContractID() { if (contractIDBuilder_ == null) { if (keyCase_ == 1) { return (com.hederahashgraph.api.proto.java.ContractID) key_; } return com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } else { if (keyCase_ == 1) { return contractIDBuilder_.getMessage(); } return com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public Builder setContractID(com.hederahashgraph.api.proto.java.ContractID value) { if (contractIDBuilder_ == null) { if (value == null) { throw new NullPointerException(); } key_ = value; onChanged(); } else { contractIDBuilder_.setMessage(value); } keyCase_ = 1; return this; } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public Builder setContractID( com.hederahashgraph.api.proto.java.ContractID.Builder builderForValue) { if (contractIDBuilder_ == null) { key_ = builderForValue.build(); onChanged(); } else { contractIDBuilder_.setMessage(builderForValue.build()); } keyCase_ = 1; return this; } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public Builder mergeContractID(com.hederahashgraph.api.proto.java.ContractID value) { if (contractIDBuilder_ == null) { if (keyCase_ == 1 && key_ != com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance()) { key_ = com.hederahashgraph.api.proto.java.ContractID.newBuilder((com.hederahashgraph.api.proto.java.ContractID) key_) .mergeFrom(value).buildPartial(); } else { key_ = value; } onChanged(); } else { if (keyCase_ == 1) { contractIDBuilder_.mergeFrom(value); } contractIDBuilder_.setMessage(value); } keyCase_ = 1; return this; } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public Builder clearContractID() { if (contractIDBuilder_ == null) { if (keyCase_ == 1) { keyCase_ = 0; key_ = null; onChanged(); } } else { if (keyCase_ == 1) { keyCase_ = 0; key_ = null; } contractIDBuilder_.clear(); } return this; } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public com.hederahashgraph.api.proto.java.ContractID.Builder getContractIDBuilder() { return getContractIDFieldBuilder().getBuilder(); } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ public com.hederahashgraph.api.proto.java.ContractIDOrBuilder getContractIDOrBuilder() { if ((keyCase_ == 1) && (contractIDBuilder_ != null)) { return contractIDBuilder_.getMessageOrBuilder(); } else { if (keyCase_ == 1) { return (com.hederahashgraph.api.proto.java.ContractID) key_; } return com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } } /** *
     * smart contract instance that is authorized as if it had signed with a key
     * 
* * .proto.ContractID contractID = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ContractID, com.hederahashgraph.api.proto.java.ContractID.Builder, com.hederahashgraph.api.proto.java.ContractIDOrBuilder> getContractIDFieldBuilder() { if (contractIDBuilder_ == null) { if (!(keyCase_ == 1)) { key_ = com.hederahashgraph.api.proto.java.ContractID.getDefaultInstance(); } contractIDBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ContractID, com.hederahashgraph.api.proto.java.ContractID.Builder, com.hederahashgraph.api.proto.java.ContractIDOrBuilder>( (com.hederahashgraph.api.proto.java.ContractID) key_, getParentForChildren(), isClean()); key_ = null; } keyCase_ = 1; onChanged();; return contractIDBuilder_; } /** *
     * ed25519 public key bytes
     * 
* * bytes ed25519 = 2; */ public com.google.protobuf.ByteString getEd25519() { if (keyCase_ == 2) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } /** *
     * ed25519 public key bytes
     * 
* * bytes ed25519 = 2; */ public Builder setEd25519(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } keyCase_ = 2; key_ = value; onChanged(); return this; } /** *
     * ed25519 public key bytes
     * 
* * bytes ed25519 = 2; */ public Builder clearEd25519() { if (keyCase_ == 2) { keyCase_ = 0; key_ = null; onChanged(); } return this; } /** *
     *RSA-3072 public key bytes
     * 
* * bytes RSA_3072 = 3; */ public com.google.protobuf.ByteString getRSA3072() { if (keyCase_ == 3) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } /** *
     *RSA-3072 public key bytes
     * 
* * bytes RSA_3072 = 3; */ public Builder setRSA3072(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } keyCase_ = 3; key_ = value; onChanged(); return this; } /** *
     *RSA-3072 public key bytes
     * 
* * bytes RSA_3072 = 3; */ public Builder clearRSA3072() { if (keyCase_ == 3) { keyCase_ = 0; key_ = null; onChanged(); } return this; } /** *
     *ECDSA with the p-384 curve public key bytes
     * 
* * bytes ECDSA_384 = 4; */ public com.google.protobuf.ByteString getECDSA384() { if (keyCase_ == 4) { return (com.google.protobuf.ByteString) key_; } return com.google.protobuf.ByteString.EMPTY; } /** *
     *ECDSA with the p-384 curve public key bytes
     * 
* * bytes ECDSA_384 = 4; */ public Builder setECDSA384(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } keyCase_ = 4; key_ = value; onChanged(); return this; } /** *
     *ECDSA with the p-384 curve public key bytes
     * 
* * bytes ECDSA_384 = 4; */ public Builder clearECDSA384() { if (keyCase_ == 4) { keyCase_ = 0; key_ = null; onChanged(); } return this; } private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ThresholdKey, com.hederahashgraph.api.proto.java.ThresholdKey.Builder, com.hederahashgraph.api.proto.java.ThresholdKeyOrBuilder> thresholdKeyBuilder_; /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public boolean hasThresholdKey() { return keyCase_ == 5; } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public com.hederahashgraph.api.proto.java.ThresholdKey getThresholdKey() { if (thresholdKeyBuilder_ == null) { if (keyCase_ == 5) { return (com.hederahashgraph.api.proto.java.ThresholdKey) key_; } return com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } else { if (keyCase_ == 5) { return thresholdKeyBuilder_.getMessage(); } return com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public Builder setThresholdKey(com.hederahashgraph.api.proto.java.ThresholdKey value) { if (thresholdKeyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } key_ = value; onChanged(); } else { thresholdKeyBuilder_.setMessage(value); } keyCase_ = 5; return this; } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public Builder setThresholdKey( com.hederahashgraph.api.proto.java.ThresholdKey.Builder builderForValue) { if (thresholdKeyBuilder_ == null) { key_ = builderForValue.build(); onChanged(); } else { thresholdKeyBuilder_.setMessage(builderForValue.build()); } keyCase_ = 5; return this; } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public Builder mergeThresholdKey(com.hederahashgraph.api.proto.java.ThresholdKey value) { if (thresholdKeyBuilder_ == null) { if (keyCase_ == 5 && key_ != com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance()) { key_ = com.hederahashgraph.api.proto.java.ThresholdKey.newBuilder((com.hederahashgraph.api.proto.java.ThresholdKey) key_) .mergeFrom(value).buildPartial(); } else { key_ = value; } onChanged(); } else { if (keyCase_ == 5) { thresholdKeyBuilder_.mergeFrom(value); } thresholdKeyBuilder_.setMessage(value); } keyCase_ = 5; return this; } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public Builder clearThresholdKey() { if (thresholdKeyBuilder_ == null) { if (keyCase_ == 5) { keyCase_ = 0; key_ = null; onChanged(); } } else { if (keyCase_ == 5) { keyCase_ = 0; key_ = null; } thresholdKeyBuilder_.clear(); } return this; } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public com.hederahashgraph.api.proto.java.ThresholdKey.Builder getThresholdKeyBuilder() { return getThresholdKeyFieldBuilder().getBuilder(); } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ public com.hederahashgraph.api.proto.java.ThresholdKeyOrBuilder getThresholdKeyOrBuilder() { if ((keyCase_ == 5) && (thresholdKeyBuilder_ != null)) { return thresholdKeyBuilder_.getMessageOrBuilder(); } else { if (keyCase_ == 5) { return (com.hederahashgraph.api.proto.java.ThresholdKey) key_; } return com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } } /** *
     * a threshold N followed by a list of M keys, any N of which are required to form a valid signature
     * 
* * .proto.ThresholdKey thresholdKey = 5; */ private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ThresholdKey, com.hederahashgraph.api.proto.java.ThresholdKey.Builder, com.hederahashgraph.api.proto.java.ThresholdKeyOrBuilder> getThresholdKeyFieldBuilder() { if (thresholdKeyBuilder_ == null) { if (!(keyCase_ == 5)) { key_ = com.hederahashgraph.api.proto.java.ThresholdKey.getDefaultInstance(); } thresholdKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.ThresholdKey, com.hederahashgraph.api.proto.java.ThresholdKey.Builder, com.hederahashgraph.api.proto.java.ThresholdKeyOrBuilder>( (com.hederahashgraph.api.proto.java.ThresholdKey) key_, getParentForChildren(), isClean()); key_ = null; } keyCase_ = 5; onChanged();; return thresholdKeyBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.KeyList, com.hederahashgraph.api.proto.java.KeyList.Builder, com.hederahashgraph.api.proto.java.KeyListOrBuilder> keyListBuilder_; /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public boolean hasKeyList() { return keyCase_ == 6; } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public com.hederahashgraph.api.proto.java.KeyList getKeyList() { if (keyListBuilder_ == null) { if (keyCase_ == 6) { return (com.hederahashgraph.api.proto.java.KeyList) key_; } return com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance(); } else { if (keyCase_ == 6) { return keyListBuilder_.getMessage(); } return com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance(); } } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public Builder setKeyList(com.hederahashgraph.api.proto.java.KeyList value) { if (keyListBuilder_ == null) { if (value == null) { throw new NullPointerException(); } key_ = value; onChanged(); } else { keyListBuilder_.setMessage(value); } keyCase_ = 6; return this; } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public Builder setKeyList( com.hederahashgraph.api.proto.java.KeyList.Builder builderForValue) { if (keyListBuilder_ == null) { key_ = builderForValue.build(); onChanged(); } else { keyListBuilder_.setMessage(builderForValue.build()); } keyCase_ = 6; return this; } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public Builder mergeKeyList(com.hederahashgraph.api.proto.java.KeyList value) { if (keyListBuilder_ == null) { if (keyCase_ == 6 && key_ != com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance()) { key_ = com.hederahashgraph.api.proto.java.KeyList.newBuilder((com.hederahashgraph.api.proto.java.KeyList) key_) .mergeFrom(value).buildPartial(); } else { key_ = value; } onChanged(); } else { if (keyCase_ == 6) { keyListBuilder_.mergeFrom(value); } keyListBuilder_.setMessage(value); } keyCase_ = 6; return this; } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public Builder clearKeyList() { if (keyListBuilder_ == null) { if (keyCase_ == 6) { keyCase_ = 0; key_ = null; onChanged(); } } else { if (keyCase_ == 6) { keyCase_ = 0; key_ = null; } keyListBuilder_.clear(); } return this; } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public com.hederahashgraph.api.proto.java.KeyList.Builder getKeyListBuilder() { return getKeyListFieldBuilder().getBuilder(); } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ public com.hederahashgraph.api.proto.java.KeyListOrBuilder getKeyListOrBuilder() { if ((keyCase_ == 6) && (keyListBuilder_ != null)) { return keyListBuilder_.getMessageOrBuilder(); } else { if (keyCase_ == 6) { return (com.hederahashgraph.api.proto.java.KeyList) key_; } return com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance(); } } /** *
     * A list of Keys of the Key type.
     * 
* * .proto.KeyList keyList = 6; */ private com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.KeyList, com.hederahashgraph.api.proto.java.KeyList.Builder, com.hederahashgraph.api.proto.java.KeyListOrBuilder> getKeyListFieldBuilder() { if (keyListBuilder_ == null) { if (!(keyCase_ == 6)) { key_ = com.hederahashgraph.api.proto.java.KeyList.getDefaultInstance(); } keyListBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.hederahashgraph.api.proto.java.KeyList, com.hederahashgraph.api.proto.java.KeyList.Builder, com.hederahashgraph.api.proto.java.KeyListOrBuilder>( (com.hederahashgraph.api.proto.java.KeyList) key_, getParentForChildren(), isClean()); key_ = null; } keyCase_ = 6; onChanged();; return keyListBuilder_; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:proto.Key) } // @@protoc_insertion_point(class_scope:proto.Key) private static final com.hederahashgraph.api.proto.java.Key DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.hederahashgraph.api.proto.java.Key(); } public static com.hederahashgraph.api.proto.java.Key getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { public Key parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Key(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } public com.hederahashgraph.api.proto.java.Key getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy