Class ExchangeRate.Builder

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
  • Method Details

    • getHbarEquiv

      public int getHbarEquiv()
       *
       Denominator for a ratio of USD cents per HBAR.
       
      int32 hbarEquiv = 1;
      Specified by:
      getHbarEquiv in interface ExchangeRateOrBuilder
      Returns:
      The hbarEquiv.
    • setHbarEquiv

      public ExchangeRate.Builder setHbarEquiv(int value)
       *
       Denominator for a ratio of USD cents per HBAR.
       
      int32 hbarEquiv = 1;
      Parameters:
      value - The hbarEquiv to set.
      Returns:
      This builder for chaining.
    • clearHbarEquiv

      public ExchangeRate.Builder 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:
      getCentEquiv in interface ExchangeRateOrBuilder
      Returns:
      The centEquiv.
    • setCentEquiv

      public ExchangeRate.Builder setCentEquiv(int value)
       *
       Numerator for a ratio of USD cents per HBAR.
       
      int32 centEquiv = 2;
      Parameters:
      value - The centEquiv to set.
      Returns:
      This builder for chaining.
    • clearCentEquiv

      public ExchangeRate.Builder 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:
      hasExpirationTime in interface ExchangeRateOrBuilder
      Returns:
      Whether the expirationTime field is set.
    • getExpirationTime

      public TimestampSeconds getExpirationTime()
       *
       Expiration time stamp for this exchange rate.
       
      .proto.TimestampSeconds expirationTime = 3;
      Specified by:
      getExpirationTime in interface ExchangeRateOrBuilder
      Returns:
      The expirationTime.
    • setExpirationTime

      public ExchangeRate.Builder setExpirationTime(TimestampSeconds value)
       *
       Expiration time stamp for this exchange rate.
       
      .proto.TimestampSeconds expirationTime = 3;
    • setExpirationTime

      public ExchangeRate.Builder setExpirationTime(TimestampSeconds.Builder builderForValue)
       *
       Expiration time stamp for this exchange rate.
       
      .proto.TimestampSeconds expirationTime = 3;
    • mergeExpirationTime

      public ExchangeRate.Builder mergeExpirationTime(TimestampSeconds value)
       *
       Expiration time stamp for this exchange rate.
       
      .proto.TimestampSeconds expirationTime = 3;
    • clearExpirationTime

      public ExchangeRate.Builder clearExpirationTime()
       *
       Expiration time stamp for this exchange rate.
       
      .proto.TimestampSeconds expirationTime = 3;