java.lang.Object
com.hedera.hashgraph.sdk.Key
com.hedera.hashgraph.sdk.KeyList
- All Implemented Interfaces:
Iterable<Key>,Collection<Key>
A list of keys that are required to sign in unison, with an optional threshold controlling how many keys of
the list are required.
See Hedera Documentation
-
Field Summary
FieldsFields inherited from class com.hedera.hashgraph.sdk.Key
ECDSA_SECP256K1_CURVE, ECDSA_SECP256K1_DOMAIN, ID_EC_PUBLIC_KEY, ID_ECDSA_SECP256K1, ID_ED25519 -
Constructor Summary
ConstructorsConstructorDescriptionKeyList()Create a new key list where all keys that are added will be required to sign. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends Key> collection) voidclear()booleanbooleancontainsAll(Collection<?> collection) boolean(package private) static KeyListfromProtobuf(KeyList keyList, Integer threshold) Create key list from protobuf.Get the threshold for the KeyList.inthashCode()booleanisEmpty()iterator()static KeyListList of keys in the key.booleanbooleanremoveAll(Collection<?> collection) booleanretainAll(Collection<?> collection) setThreshold(int threshold) Set a threshold for the KeyList.intsize()Object[]toArray()<T> T[]toArray(T[] ts) (package private) KeyListConvert into protobuf representation.(package private) KeySerialize this key as a protobuf objecttoString()static KeyListwithThreshold(int threshold) Create a new key list where at leastthresholdkeys must sign.Methods inherited from class com.hedera.hashgraph.sdk.Key
fromBytes, fromProtobufKey, toBytesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Field Details
-
threshold
The minimum number of keys that must sign.
-
-
Constructor Details
-
KeyList
public KeyList()Create a new key list where all keys that are added will be required to sign.
-
-
Method Details
-
of
List of keys in the key.- Parameters:
keys- the key / key list- Returns:
- a list of the keys
-
withThreshold
Create a new key list where at leastthresholdkeys must sign.- Parameters:
threshold- the minimum number of keys that must sign- Returns:
- KeyList
-
fromProtobuf
Create key list from protobuf.- Parameters:
keyList- the key listthreshold- the minimum number of keys that must sign- Returns:
- the key list
-
getThreshold
Get the threshold for the KeyList.- Returns:
- int
-
setThreshold
Set a threshold for the KeyList.- Parameters:
threshold- the minimum number of keys that must sign- Returns:
- KeyList
-
size
public int size()- Specified by:
sizein interfaceCollection<Key>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<Key>
-
contains
- Specified by:
containsin interfaceCollection<Key>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<Key>
-
toArray
public <T> T[] toArray(T[] ts) - Specified by:
toArrayin interfaceCollection<Key>
-
add
- Specified by:
addin interfaceCollection<Key>
-
remove
- Specified by:
removein interfaceCollection<Key>
-
containsAll
- Specified by:
containsAllin interfaceCollection<Key>
-
addAll
- Specified by:
addAllin interfaceCollection<Key>
-
removeAll
- Specified by:
removeAllin interfaceCollection<Key>
-
retainAll
- Specified by:
retainAllin interfaceCollection<Key>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Key>
-
toProtobufKey
Key toProtobufKey()Description copied from class:KeySerialize this key as a protobuf object- Specified by:
toProtobufKeyin classKey
-
toProtobuf
KeyList toProtobuf()Convert into protobuf representation.- Returns:
- the protobuf representation
-
toString
-
equals
- Specified by:
equalsin interfaceCollection<Key>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Key>- Overrides:
hashCodein classObject
-