Class WeightedMultiSigOptions


  • public class WeightedMultiSigOptions
    extends java.lang.Object
    Representing an options for AccountKeyWeightedMultiSig. This class will define threshold and weights.
    • Constructor Summary

      Constructors 
      Constructor Description
      WeightedMultiSigOptions()
      Creates a empty WeightedMultiSIgOptions instance This instance used when setting AccountKeyPublic to AccountKeyRoleBased component.
      WeightedMultiSigOptions​(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
      Creates a WeightedMultiSigOptions instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<WeightedMultiSigOptions> getDefaultOptionsForRoleBased​(java.util.List<java.lang.String[]> roleBasedPublicKeys)
      Creates a List that has WeightedMultiSigOptions instance with default value.(threshold, weight has 1)
      static WeightedMultiSigOptions getDefaultOptionsForWeightedMultiSig​(java.lang.String[] publicKeyArr)
      Create a WeightedMultiSigOptions instance with default value.(threshold, weight has 1)
      java.math.BigInteger getThreshold()
      Getter function for threshold
      java.util.List<java.math.BigInteger> getWeights()
      Getter function for list of weight
      boolean isEmpty()  
      boolean isValidateOptions​(java.math.BigInteger threshold, java.util.List<java.math.BigInteger> weights)
      Before creating an instance, check whether the passed option is valid.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAX_COUNT_WEIGHTED_PUBLIC_KEY

        public static final int MAX_COUNT_WEIGHTED_PUBLIC_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • WeightedMultiSigOptions

        public WeightedMultiSigOptions()
        Creates a empty WeightedMultiSIgOptions instance This instance used when setting AccountKeyPublic to AccountKeyRoleBased component.
      • WeightedMultiSigOptions

        public WeightedMultiSigOptions​(java.math.BigInteger threshold,
                                       java.util.List<java.math.BigInteger> weights)
        Creates a WeightedMultiSigOptions instance.
        Parameters:
        threshold - a threshold
        weights - a List contains weight value of key
    • Method Detail

      • getDefaultOptionsForWeightedMultiSig

        public static WeightedMultiSigOptions getDefaultOptionsForWeightedMultiSig​(java.lang.String[] publicKeyArr)
        Create a WeightedMultiSigOptions instance with default value.(threshold, weight has 1)
        Parameters:
        publicKeyArr - public key array
        Returns:
        WeightedMultiSigOptions
      • getDefaultOptionsForRoleBased

        public static java.util.List<WeightedMultiSigOptions> getDefaultOptionsForRoleBased​(java.util.List<java.lang.String[]> roleBasedPublicKeys)
        Creates a List that has WeightedMultiSigOptions instance with default value.(threshold, weight has 1)
        Parameters:
        roleBasedPublicKeys - Public key list instance for using AccountKeyRolebased.
        Returns:
        List
      • isValidateOptions

        public boolean isValidateOptions​(java.math.BigInteger threshold,
                                         java.util.List<java.math.BigInteger> weights)
        Before creating an instance, check whether the passed option is valid. - check threshold value bigger than zero - weights has weight up to 10 - threshold must have value smaller than sum of weights item
        Parameters:
        threshold - a threshold
        weights -
        Returns:
      • isEmpty

        public boolean isEmpty()
      • getThreshold

        public java.math.BigInteger getThreshold()
        Getter function for threshold
        Returns:
        threshold
      • getWeights

        public java.util.List<java.math.BigInteger> getWeights()
        Getter function for list of weight
        Returns:
        weights