IExtDataBinder
public class ItemResult extends java.lang.Object implements IExtDataBinder
Modifier and Type | Field | Description |
---|---|---|
@NonNull java.time.ZonedDateTime |
createdAt |
Time when the item was created on the node.
|
static ItemResult |
DISCARDED |
|
java.util.List<ErrorRecord> |
errors |
|
@NonNull java.time.ZonedDateTime |
expiresAt |
Current expiration time.
|
net.sergeych.tools.Binder |
extraDataBinder |
|
boolean |
haveCopy |
true if the node has the copy of approvable item at the moment.
|
boolean |
isTestnet |
|
HashId |
lockedById |
|
net.sergeych.tools.Binder |
meta |
|
@NonNull ItemState |
state |
The current state of the item in question
|
static ItemResult |
UNDEFINED |
Constructor | Description |
---|---|
ItemResult(IStateRecord record) |
Initialize from a record
|
ItemResult(IStateRecord record,
boolean haveCopy) |
Initialize from a record and posession flag
|
ItemResult(ItemState state,
boolean haveCopy,
@NonNull java.time.ZonedDateTime createdAt,
@NonNull java.time.ZonedDateTime expiresAt) |
|
ItemResult(net.sergeych.boss.Boss.Reader br) |
|
ItemResult(net.sergeych.tools.Binder fields) |
Construct from serialized parameters, presented in the binder instance
|
Modifier and Type | Method | Description |
---|---|---|
ItemResult |
copy() |
|
boolean |
equals(java.lang.Object obj) |
The equivalence is not absolutely exact.
|
net.sergeych.tools.Binder |
getExtraBinder() |
Returns extra
Binder . |
net.sergeych.tools.Binder |
toBinder() |
|
java.lang.String |
toString() |
|
void |
writeTo(net.sergeych.boss.Boss.Writer bw) |
public static final ItemResult DISCARDED
public static final ItemResult UNDEFINED
public final @NonNull ItemState state
public final boolean haveCopy
public final @NonNull java.time.ZonedDateTime createdAt
public final @NonNull java.time.ZonedDateTime expiresAt
public java.util.List<ErrorRecord> errors
public HashId lockedById
public final transient net.sergeych.tools.Binder meta
public boolean isTestnet
public net.sergeych.tools.Binder extraDataBinder
public ItemResult(IStateRecord record, boolean haveCopy)
record
- record to get data fromhaveCopy
- true if the node has a copy of the Approvable
item (e.g. one can try go call com.icodici.universa.node2.network.Network#getItem(HashId, NodeInfo, Duration)
on itpublic ItemResult(IStateRecord record)
record
- to get data frompublic ItemResult(net.sergeych.tools.Binder fields)
fields
- binder with named parameters (case sensitive field names, like haveCopy or createdAt)public ItemResult(ItemState state, boolean haveCopy, @NonNull java.time.ZonedDateTime createdAt, @NonNull java.time.ZonedDateTime expiresAt)
public ItemResult(net.sergeych.boss.Boss.Reader br) throws java.io.IOException
java.io.IOException
public net.sergeych.tools.Binder toBinder()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
expiresAt
and createdAt
only truncated to seconds. So, if comarison with maximum
precision is of essence, compare these fields separately.equals
in class java.lang.Object
obj
- presumably another ItemResult
instancepublic net.sergeych.tools.Binder getExtraBinder()
IExtDataBinder
Binder
. Creates new Binder if its null.getExtraBinder
in interface IExtDataBinder
public void writeTo(net.sergeych.boss.Boss.Writer bw) throws java.io.IOException
java.io.IOException
public ItemResult copy()