Package org.stellar.sdk.xdr
Class SCPStatement
java.lang.Object
org.stellar.sdk.xdr.SCPStatement
- All Implemented Interfaces:
XdrElement
SCPStatement's original definition in the XDR file is:
struct SCPStatement
{
NodeID nodeID; // v
uint64 slotIndex; // i
union switch (SCPStatementType type)
{
case SCP_ST_PREPARE:
struct
{
Hash quorumSetHash; // D
SCPBallot ballot; // b
SCPBallot* prepared; // p
SCPBallot* preparedPrime; // p'
uint32 nC; // c.n
uint32 nH; // h.n
} prepare;
case SCP_ST_CONFIRM:
struct
{
SCPBallot ballot; // b
uint32 nPrepared; // p.n
uint32 nCommit; // c.n
uint32 nH; // h.n
Hash quorumSetHash; // D
} confirm;
case SCP_ST_EXTERNALIZE:
struct
{
SCPBallot commit; // c
uint32 nH; // h.n
Hash commitQuorumSetHash; // D used before EXTERNALIZE
} externalize;
case SCP_ST_NOMINATE:
SCPNomination nominate;
}
pledges;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classSCPStatementPledges's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionSCPStatement(NodeID nodeID, Uint64 slotIndex, SCPStatement.SCPStatementPledges pledges) Creates a newSCPStatementinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static SCPStatementdecode(XdrDataInputStream stream) static SCPStatementdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic SCPStatementstatic SCPStatementfromXdrBase64(String xdr) static SCPStatementfromXdrByteArray(byte[] xdr) Value of thenodeIDfield.Value of thepledgesfield.Value of theslotIndexfield.inthashCode()voidValue of thenodeIDfield.voidValue of thepledgesfield.voidsetSlotIndex(Uint64 slotIndex) Value of theslotIndexfield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
SCPStatement
public SCPStatement() -
SCPStatement
Creates a newSCPStatementinstance.- Parameters:
nodeID- thenodeIDfield valueslotIndex- theslotIndexfield valuepledges- thepledgesfield value
-
-
Method Details
-
encode
Description copied from interface:XdrElementEncodes this value to XDR and writes it to the provided stream.- Specified by:
encodein interfaceXdrElement- Parameters:
stream- the destination XDR output stream- Throws:
IOException- if an I/O error occurs while writing the value
-
decode
- Throws:
IOException
-
decode
- Throws:
IOException
-
fromXdrBase64
- Throws:
IOException
-
fromXdrByteArray
- Throws:
IOException
-
toJson
Description copied from interface:XdrElementSerializes this value to JSON.- Specified by:
toJsonin interfaceXdrElement- Returns:
- the JSON representation of this value
-
fromJson
-
builder
-
toBuilder
-
getNodeID
Value of thenodeIDfield.- Returns:
- the
nodeIDfield value
-
getSlotIndex
Value of theslotIndexfield.- Returns:
- the
slotIndexfield value
-
getPledges
Value of thepledgesfield.- Returns:
- the
pledgesfield value
-
setNodeID
Value of thenodeIDfield.- Parameters:
nodeID- thenodeIDfield value
-
setSlotIndex
Value of theslotIndexfield.- Parameters:
slotIndex- theslotIndexfield value
-
setPledges
Value of thepledgesfield.- Parameters:
pledges- thepledgesfield value
-
equals
-
hashCode
public int hashCode() -
toString
-