Class ImmutableGetAggregatePriceResult
java.lang.Object
org.xrpl.xrpl4j.model.client.oracle.ImmutableGetAggregatePriceResult
- All Implemented Interfaces:
GetAggregatePriceResult,XrplResult
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
@CheckReturnValue
public final class ImmutableGetAggregatePriceResult
extends Object
implements GetAggregatePriceResult
Immutable implementation of
GetAggregatePriceResult.
Use the builder to create immutable instances:
ImmutableGetAggregatePriceResult.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableGetAggregatePriceResult. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableGetAggregatePriceResult.copyOf(GetAggregatePriceResult instance) Creates an immutable copy of aGetAggregatePriceResultvalue.The statistics from the collected oracle prices.booleanThis instance is equal to all instances ofImmutableGetAggregatePriceResultthat have equal attribute values.inthashCode()Computes a hash code from attributes:status,entireSet,trimmedSet,medianString,time,ledgerHash,ledgerIndex,ledgerCurrentIndex,validated.The ledger index of the current open ledger, which was used when retrieving this information.The identifying Hash of the ledger version used to generate this response.The Ledger Index of the ledger version used to generate this response.median()Get the median price as aBigDecimal.The median price, as aString.status()The value"success"indicates the request was successfully received and understood by the server.com.google.common.primitives.UnsignedIntegertime()The most recent timestamp out of all LastUpdateTime values.toString()Prints the immutable valueGetAggregatePriceResultwith attribute values.The trimmed statistics from the collected oracle prices.booleanIf true, the information in this response comes from a validated ledger version.withEntireSet(AggregatePriceSet value) Copy the current immutable object by setting a value for theentireSetattribute.withLedgerCurrentIndex(Optional<? extends LedgerIndex> optional) Copy the current immutable object by setting an optional value for theledgerCurrentIndexattribute.Copy the current immutable object by setting a present value for the optionalledgerCurrentIndexattribute.withLedgerHash(Optional<? extends Hash256> optional) Copy the current immutable object by setting an optional value for theledgerHashattribute.withLedgerHash(Hash256 value) Copy the current immutable object by setting a present value for the optionalledgerHashattribute.withLedgerIndex(Optional<? extends LedgerIndex> optional) Copy the current immutable object by setting an optional value for theledgerIndexattribute.withLedgerIndex(LedgerIndex value) Copy the current immutable object by setting a present value for the optionalledgerIndexattribute.withMedianString(String value) Copy the current immutable object by setting a value for themedianStringattribute.withStatus(String value) Copy the current immutable object by setting a present value for the optionalstatusattribute.withStatus(Optional<String> optional) Copy the current immutable object by setting an optional value for thestatusattribute.withTime(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetimeattribute.withTrimmedSet(Optional<? extends AggregatePriceSet> optional) Copy the current immutable object by setting an optional value for thetrimmedSetattribute.withTrimmedSet(AggregatePriceSet value) Copy the current immutable object by setting a present value for the optionaltrimmedSetattribute.withValidated(boolean value) Copy the current immutable object by setting a value for thevalidatedattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.xrpl.xrpl4j.model.client.oracle.GetAggregatePriceResult
ledgerCurrentIndexSafe, ledgerHashSafe, ledgerIndexSafe
-
Method Details
-
status
The value"success"indicates the request was successfully received and understood by the server.- Specified by:
statusin interfaceXrplResult- Returns:
- The
String"success"if the request was successful, otherwiseOptional.empty().
-
entireSet
The statistics from the collected oracle prices.- Specified by:
entireSetin interfaceGetAggregatePriceResult- Returns:
- An
AggregatePriceSet.
-
trimmedSet
The trimmed statistics from the collected oracle prices. Only appears if the trim field was specified in the request.- Specified by:
trimmedSetin interfaceGetAggregatePriceResult- Returns:
- An
OptionalAggregatePriceSet.
-
medianString
The median price, as aString.- Specified by:
medianStringin interfaceGetAggregatePriceResult- Returns:
- A
String.
-
time
public com.google.common.primitives.UnsignedInteger time()The most recent timestamp out of all LastUpdateTime values.- Specified by:
timein interfaceGetAggregatePriceResult- Returns:
- An
UnsignedInteger.
-
ledgerHash
The identifying Hash of the ledger version used to generate this response.- Specified by:
ledgerHashin interfaceGetAggregatePriceResult- Returns:
- A
Hash256containing the ledger hash.
-
ledgerIndex
The Ledger Index of the ledger version used to generate this response. Only present in responses to requests with ledger_index = "validated" or "closed".- Specified by:
ledgerIndexin interfaceGetAggregatePriceResult- Returns:
- A
LedgerIndex.
-
ledgerCurrentIndex
The ledger index of the current open ledger, which was used when retrieving this information. Only present in responses to requests with ledger_index = "current".- Specified by:
ledgerCurrentIndexin interfaceGetAggregatePriceResult- Returns:
- An optionally-present
LedgerIndexrepresenting the current ledger index.
-
validated
public boolean validated()If true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change.- Specified by:
validatedin interfaceGetAggregatePriceResult- Returns:
trueif the information in this response comes from a validated ledger version,falseif not.
-
withStatus
Copy the current immutable object by setting a present value for the optionalstatusattribute.- Parameters:
value- The value for status- Returns:
- A modified copy of
thisobject
-
withStatus
Copy the current immutable object by setting an optional value for thestatusattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for status- Returns:
- A modified copy of
thisobject
-
withEntireSet
Copy the current immutable object by setting a value for theentireSetattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for entireSet- Returns:
- A modified copy of the
thisobject
-
withTrimmedSet
Copy the current immutable object by setting a present value for the optionaltrimmedSetattribute.- Parameters:
value- The value for trimmedSet- Returns:
- A modified copy of
thisobject
-
withTrimmedSet
public final ImmutableGetAggregatePriceResult withTrimmedSet(Optional<? extends AggregatePriceSet> optional) Copy the current immutable object by setting an optional value for thetrimmedSetattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for trimmedSet- Returns:
- A modified copy of
thisobject
-
withMedianString
Copy the current immutable object by setting a value for themedianStringattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for medianString- Returns:
- A modified copy of the
thisobject
-
withTime
public final ImmutableGetAggregatePriceResult withTime(com.google.common.primitives.UnsignedInteger value) Copy the current immutable object by setting a value for thetimeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for time- Returns:
- A modified copy of the
thisobject
-
withLedgerHash
Copy the current immutable object by setting a present value for the optionalledgerHashattribute.- Parameters:
value- The value for ledgerHash- Returns:
- A modified copy of
thisobject
-
withLedgerHash
Copy the current immutable object by setting an optional value for theledgerHashattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ledgerHash- Returns:
- A modified copy of
thisobject
-
withLedgerIndex
Copy the current immutable object by setting a present value for the optionalledgerIndexattribute.- Parameters:
value- The value for ledgerIndex- Returns:
- A modified copy of
thisobject
-
withLedgerIndex
public final ImmutableGetAggregatePriceResult withLedgerIndex(Optional<? extends LedgerIndex> optional) Copy the current immutable object by setting an optional value for theledgerIndexattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ledgerIndex- Returns:
- A modified copy of
thisobject
-
withLedgerCurrentIndex
Copy the current immutable object by setting a present value for the optionalledgerCurrentIndexattribute.- Parameters:
value- The value for ledgerCurrentIndex- Returns:
- A modified copy of
thisobject
-
withLedgerCurrentIndex
public final ImmutableGetAggregatePriceResult withLedgerCurrentIndex(Optional<? extends LedgerIndex> optional) Copy the current immutable object by setting an optional value for theledgerCurrentIndexattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ledgerCurrentIndex- Returns:
- A modified copy of
thisobject
-
withValidated
Copy the current immutable object by setting a value for thevalidatedattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for validated- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofImmutableGetAggregatePriceResultthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:status,entireSet,trimmedSet,medianString,time,ledgerHash,ledgerIndex,ledgerCurrentIndex,validated. -
toString
Prints the immutable valueGetAggregatePriceResultwith attribute values. -
median
Get the median price as aBigDecimal.Returns a lazily initialized value of the
medianattribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
medianin interfaceGetAggregatePriceResult- Returns:
- A lazily initialized value of the
medianattribute
-
copyOf
Creates an immutable copy of aGetAggregatePriceResultvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable GetAggregatePriceResult instance
-
builder
Creates a builder forImmutableGetAggregatePriceResult.ImmutableGetAggregatePriceResult.builder() .status(String) // optionalstatus.entireSet(org.xrpl.xrpl4j.model.client.oracle.AggregatePriceSet) // requiredentireSet.trimmedSet(org.xrpl.xrpl4j.model.client.oracle.AggregatePriceSet) // optionaltrimmedSet.medianString(String) // requiredmedianString.time(com.google.common.primitives.UnsignedInteger) // requiredtime.ledgerHash(org.xrpl.xrpl4j.model.transactions.Hash256) // optionalledgerHash.ledgerIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optionalledgerIndex.ledgerCurrentIndex(org.xrpl.xrpl4j.model.client.common.LedgerIndex) // optionalledgerCurrentIndex.validated(boolean) // optionalvalidated.build();- Returns:
- A new ImmutableGetAggregatePriceResult builder
-