java.io.Serializable
, java.lang.Comparable<ItemState>
public enum ItemState extends java.lang.Enum<ItemState>
Approvable
item.
Allowed states:
(UNDEFINED) -- PENDING -- (destroyed by expiration) -- PENDING_NEGATIVE | PENDING_POSITIVE -- APPROVED -- DECLINED -- (destroyed by expiration) -- APPROVED -- DECLINED -- (destroyed by expiration) -- LOCKED_FOR_CREATION -- APPROVED -- (destroyed) ------------------------------------------------------------ (APPROVED) -- LOCKED -- APPROVED -- REVOKED -- (destroyed by expiration)
Enum Constant | Description |
---|---|
APPROVED |
The positive consensus is found for the contract, it was approved by the network and is not yet revoked.
|
DECLINED |
The contract was checked by the netwokr and negative consensus was found.
|
DISCARDED |
the item must be discarded without further processing
|
LOCKED |
The item is locked for revokation by some transactoin
|
LOCKED_FOR_CREATION |
Special state: locked by another mending item that will create and approve this item if approved by the
consensus.
|
LOCKED_FOR_CREATION_REVOKED |
Special state: LOCKED_FOR_CREATION item being revoke within the same transaction.
|
PENDING |
The contract is being processed.
|
PENDING_NEGATIVE |
The contract is locally checked and found bad, but voting is yet in progress and yet no consensus is found.
|
PENDING_POSITIVE |
The contract is locally checked and found OK against local ledger, voting is in progress and no consensus is
found.
|
REVOKED |
The contract once approved by the netowork is now revoked and is neing kept in archive for approproate time.
|
UNDEFINED |
Bad state, can't process.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
isApproved() |
Check that state means the item is approved and not archived, e.g.
|
boolean |
isConsensusFound() |
Check that either positive or negative consensus was found
|
boolean |
isPending() |
Check that state means the item is being processed by the network and no consensus yet is found.
|
boolean |
isPositive() |
|
static ItemState |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static ItemState[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ItemState UNDEFINED
public static final ItemState PENDING
public static final ItemState PENDING_POSITIVE
public static final ItemState PENDING_NEGATIVE
public static final ItemState APPROVED
public static final ItemState LOCKED
public static final ItemState REVOKED
public static final ItemState DECLINED
public static final ItemState DISCARDED
public static final ItemState LOCKED_FOR_CREATION
public static final ItemState LOCKED_FOR_CREATION_REVOKED
public static ItemState[] values()
for (ItemState c : ItemState.values()) System.out.println(c);
public static ItemState valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isConsensusFound()
public boolean isApproved()
public boolean isPending()
public boolean isPositive()