Package org.stellar.sdk.xdr
Class Preconditions
java.lang.Object
org.stellar.sdk.xdr.Preconditions
- All Implemented Interfaces:
XdrElement
Preconditions's original definition in the XDR file is:
union Preconditions switch (PreconditionType type)
{
case PRECOND_NONE:
void;
case PRECOND_TIME:
TimeBounds timeBounds;
case PRECOND_V2:
PreconditionsV2 v2;
};
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.stellar.sdk.xdr.XdrElement
gson -
Constructor Summary
ConstructorsConstructorDescriptionPreconditions(PreconditionType discriminant, TimeBounds timeBounds, PreconditionsV2 v2) Creates a newPreconditionsinstance. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()static Preconditionsdecode(XdrDataInputStream stream) static Preconditionsdecode(XdrDataInputStream stream, int maxDepth) voidencode(XdrDataOutputStream stream) Encodes this value to XDR and writes it to the provided stream.booleanstatic Preconditionsstatic PreconditionsfromXdrBase64(String xdr) static PreconditionsfromXdrByteArray(byte[] xdr) Value of thediscriminantfield.Value of thetimeBoundsfield.getV2()Value of thev2field.inthashCode()voidsetDiscriminant(PreconditionType discriminant) Value of thediscriminantfield.voidsetTimeBounds(TimeBounds timeBounds) Value of thetimeBoundsfield.voidsetV2(PreconditionsV2 v2) Value of thev2field.toJson()Serializes this value to JSON.toString()Methods inherited from interface org.stellar.sdk.xdr.XdrElement
toXdrBase64, toXdrByteArray
-
Constructor Details
-
Preconditions
public Preconditions() -
Preconditions
Creates a newPreconditionsinstance.- Parameters:
discriminant- thediscriminantfield valuetimeBounds- thetimeBoundsfield valuev2- thev2field 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
-
getDiscriminant
Value of thediscriminantfield.- Returns:
- the
discriminantfield value
-
getTimeBounds
Value of thetimeBoundsfield.- Returns:
- the
timeBoundsfield value
-
getV2
Value of thev2field.- Returns:
- the
v2field value
-
setDiscriminant
Value of thediscriminantfield.- Parameters:
discriminant- thediscriminantfield value
-
setTimeBounds
Value of thetimeBoundsfield.- Parameters:
timeBounds- thetimeBoundsfield value
-
setV2
Value of thev2field.- Parameters:
v2- thev2field value
-
equals
-
hashCode
public int hashCode() -
toString
-