java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<ExchangeRate,ExchangeRate.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<ExchangeRate,ExchangeRate.Builder>
com.hedera.hashgraph.sdk.proto.ExchangeRate.Builder
- All Implemented Interfaces:
com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,ExchangeRateOrBuilder,Cloneable
- Enclosing class:
ExchangeRate
public static final class ExchangeRate.Builder
extends com.google.protobuf.GeneratedMessageLite.Builder<ExchangeRate,ExchangeRate.Builder>
implements ExchangeRateOrBuilder
* An exchange rate as a ratio of USD cents per HBAR. This ratio SHALL be used to convert tinycent (`10<sup>-8</sup>` USD cent) to tinybar for fees and other purposes.<br/> When applying an `ExchangeRate`, implementations SHOULD ensure input values are `tinycent` and/or `tinybar` before applying the exchange ratio.<br/> Exchange results MAY be converted to USD or HBAR via division if whole unit values are required. The ratio described here SHALL be assigned such that a value in `tinybar` may be obtained with the following equation. ``` amountInTinybar = (amountInTinycent * hbarEquiv) / centEquiv ```Protobuf type
proto.ExchangeRate-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance -
Method Summary
Modifier and TypeMethodDescription* Numerator for a ratio of USD cents per HBAR.* Expiration time stamp for this exchange rate.* Denominator for a ratio of USD cents per HBAR.int* Numerator for a ratio of USD cents per HBAR.* Expiration time stamp for this exchange rate.int* Denominator for a ratio of USD cents per HBAR.boolean* Expiration time stamp for this exchange rate.* Expiration time stamp for this exchange rate.setCentEquiv(int value) * Numerator for a ratio of USD cents per HBAR.* Expiration time stamp for this exchange rate.setExpirationTime(TimestampSeconds.Builder builderForValue) * Expiration time stamp for this exchange rate.setHbarEquiv(int value) * Denominator for a ratio of USD cents per HBAR.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFromMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Method Details
-
getHbarEquiv
public int getHbarEquiv()* Denominator for a ratio of USD cents per HBAR.
int32 hbarEquiv = 1;- Specified by:
getHbarEquivin interfaceExchangeRateOrBuilder- Returns:
- The hbarEquiv.
-
setHbarEquiv
* Denominator for a ratio of USD cents per HBAR.
int32 hbarEquiv = 1;- Parameters:
value- The hbarEquiv to set.- Returns:
- This builder for chaining.
-
clearHbarEquiv
* Denominator for a ratio of USD cents per HBAR.
int32 hbarEquiv = 1;- Returns:
- This builder for chaining.
-
getCentEquiv
public int getCentEquiv()* Numerator for a ratio of USD cents per HBAR.
int32 centEquiv = 2;- Specified by:
getCentEquivin interfaceExchangeRateOrBuilder- Returns:
- The centEquiv.
-
setCentEquiv
* Numerator for a ratio of USD cents per HBAR.
int32 centEquiv = 2;- Parameters:
value- The centEquiv to set.- Returns:
- This builder for chaining.
-
clearCentEquiv
* Numerator for a ratio of USD cents per HBAR.
int32 centEquiv = 2;- Returns:
- This builder for chaining.
-
hasExpirationTime
public boolean hasExpirationTime()* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3;- Specified by:
hasExpirationTimein interfaceExchangeRateOrBuilder- Returns:
- Whether the expirationTime field is set.
-
getExpirationTime
* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3;- Specified by:
getExpirationTimein interfaceExchangeRateOrBuilder- Returns:
- The expirationTime.
-
setExpirationTime
* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3; -
setExpirationTime
* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3; -
mergeExpirationTime
* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3; -
clearExpirationTime
* Expiration time stamp for this exchange rate.
.proto.TimestampSeconds expirationTime = 3;
-