-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCertificationStatus.java
More file actions
74 lines (68 loc) · 2 KB
/
Copy pathCertificationStatus.java
File metadata and controls
74 lines (68 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package org.unicitylabs.sdk.api;
/**
* Status codes for certification.
*/
public enum CertificationStatus {
/**
* The certification request was accepted and stored.
*/
SUCCESS("SUCCESS"),
/**
* The certification request failed because the state ID does not match the expected format.
*/
STATE_ID_MISMATCH("STATE_ID_MISMATCH"),
/**
* The certification request failed because the signature verification failed.
*/
SIGNATURE_VERIFICATION_FAILED("SIGNATURE_VERIFICATION_FAILED"),
/**
* The certification request failed because signature has invalid format.
*/
INVALID_SIGNATURE_FORMAT("INVALID_SIGNATURE_FORMAT"),
/**
* The certification request failed because the public key has invalid format.
*/
INVALID_PUBLIC_KEY_FORMAT("INVALID_PUBLIC_KEY_FORMAT"),
/**
* The certification request failed because the source state hash has invalid format.
*/
INVALID_SOURCE_STATE_HASH_FORMAT("INVALID_SOURCE_STATE_HASH_FORMAT"),
/**
* The certification request failed because the transaction hash has invalid format.
*/
INVALID_TRANSACTION_HASH_FORMAT("INVALID_TRANSACTION_HASH_FORMAT"),
/**
* The certification request failed because the algorithm is not supported.
*/
UNSUPPORTED_ALGORITHM("UNSUPPORTED_ALGORITHM"),
/**
* The certification request failed because request was sent to invalid shard.
*/
INVALID_SHARD("INVALID_SHARD");
private final String value;
CertificationStatus(String value) {
this.value = value;
}
/**
* Get string value of the status.
*
* @return string value
*/
public String getValue() {
return value;
}
/**
* Create status from string value.
*
* @param value string value
* @return status
*/
public static CertificationStatus fromString(String value) {
for (CertificationStatus status : CertificationStatus.values()) {
if (status.value.equalsIgnoreCase(value)) {
return status;
}
}
throw new IllegalArgumentException("Unknown status: " + value);
}
}