Package org.stellar.sdk.xdr
Class SCPStatement.SCPStatementPledges
java.lang.Object
org.stellar.sdk.xdr.SCPStatement.SCPStatementPledges
- All Implemented Interfaces:
XdrElement
- Enclosing class:
SCPStatement
SCPStatementPledges's original definition in the XDR file is:
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;
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSCPStatementConfirm's original definition in the XDR file is:static classSCPStatementExternalize's original definition in the XDR file is:static classstatic classSCPStatementPrepare's original definition in the XDR file is: -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionSCPStatementPledges(SCPStatementType discriminant, SCPStatement.SCPStatementPledges.SCPStatementPrepare prepare, SCPStatement.SCPStatementPledges.SCPStatementConfirm confirm, SCPStatement.SCPStatementPledges.SCPStatementExternalize externalize, SCPNomination nominate) Creates a newSCPStatementPledgesinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()decode(XdrDataInputStream stream) decode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanfromXdrBase64(String xdr) fromXdrByteArray(byte[] xdr) Value of theconfirmfield.Value of thediscriminantfield.Value of theexternalizefield.Value of thenominatefield.Value of thepreparefield.inthashCode()voidValue of theconfirmfield.voidsetDiscriminant(SCPStatementType discriminant) Value of thediscriminantfield.voidValue of theexternalizefield.voidsetNominate(SCPNomination nominate) Value of thenominatefield.voidValue of thepreparefield.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
SCPStatementPledges
public SCPStatementPledges() -
SCPStatementPledges
public SCPStatementPledges(SCPStatementType discriminant, SCPStatement.SCPStatementPledges.SCPStatementPrepare prepare, SCPStatement.SCPStatementPledges.SCPStatementConfirm confirm, SCPStatement.SCPStatementPledges.SCPStatementExternalize externalize, SCPNomination nominate) Creates a newSCPStatementPledgesinstance.- Parameters:
discriminant- thediscriminantfield valueprepare- thepreparefield valueconfirm- theconfirmfield valueexternalize- theexternalizefield valuenominate- thenominatefield 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
public static SCPStatement.SCPStatementPledges decode(XdrDataInputStream stream, int maxDepth) throws IOException - 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
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getPrepare
Value of thepreparefield.- Returns:
- the
preparefield value
-
getConfirm
Value of theconfirmfield.- Returns:
- the
confirmfield value
-
getExternalize
Value of theexternalizefield.- Returns:
- the
externalizefield value
-
getNominate
Value of thenominatefield.- Returns:
- the
nominatefield value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setPrepare
Value of thepreparefield.- Parameters:
prepare- thepreparefield value
-
setConfirm
Value of theconfirmfield.- Parameters:
confirm- theconfirmfield value
-
setExternalize
Value of theexternalizefield.- Parameters:
externalize- theexternalizefield value
-
setNominate
Value of thenominatefield.- Parameters:
nominate- thenominatefield value
-
equals
-
hashCode
public int hashCode() -
toString
-