Enum Class UserCodeData

java.lang.Object
java.lang.Enum<UserCodeData>
it.unibo.ds.chainvote.utils.UserCodeData
All Implemented Interfaces:
Serializable, Comparable<UserCodeData>, Constable

public enum UserCodeData extends Enum<UserCodeData>
An enum describing the common transient data expected as transaction inputs.
  • Enum Constant Details

    • USER_ID

      public static final UserCodeData USER_ID
      The user identifier entry key.
    • CODE

      public static final UserCodeData CODE
      The one-time-code entry key.
    • SEED

      public static final UserCodeData SEED
      The seed used to inject randomness in the OneTimeCode generation.
  • Method Details

    • values

      public static UserCodeData[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UserCodeData valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getKey

      public String getKey()
      Returns:
      the key with which this entry is represented.
    • getUserCodePairFrom

      public static it.unibo.ds.chainvote.utils.Pair<String,String> getUserCodePairFrom(Map<String,byte[]> transientData)
      Parameters:
      transientData - the Map containing the transient data
      Returns:
      a 2-dimensional tuple where the first element is the user identifier and the second the one-time-code.
      Throws:
      org.hyperledger.fabric.shim.ChaincodeException - if the given map not contains both CODE and USER_ID entries.