Package org.apache.tuweni.units.ethereum
Class Wei
- All Implemented Interfaces:
Comparable<org.apache.tuweni.bytes.Bytes>,org.apache.tuweni.bytes.Bytes,org.apache.tuweni.bytes.Bytes32,UInt256Value<Wei>
A unit measure of Wei as used by the Ethereum VM.
-
Field Summary
FieldsFields inherited from interface org.apache.tuweni.bytes.Bytes
EMPTYFields inherited from interface org.apache.tuweni.bytes.Bytes32
SIZE -
Method Summary
Modifier and TypeMethodDescriptionstatic WeifromEth(long ethValue) Return aWeicontaining the specified value from an ETHstatic WeivalueOf(long value) Return aWeicontaining the specified value.static WeivalueOf(BigInteger value) Return aWeicontaining the specified value.static WeiReturn aWeicontaining the specified value.Methods inherited from class org.apache.tuweni.units.bigints.BaseUInt256Value
add, add, add, addMod, addMod, addMod, addMod, compareTo, copy, divide, divide, divide, divideCeil, divideCeil, divideCeil, equals, get, hashCode, max, mod, mod, mod0, mod0, multiply, multiply, multiply, multiplyMod, multiplyMod, multiplyMod, multiplyMod, mutableCopy, pow, pow, slice, subtract, subtract, subtract, toBytes, toLong, toMinimalBytes, toString, toUInt256, zeroMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tuweni.bytes.Bytes
and, and, appendHexTo, appendTo, appendTo, bitLength, commonPrefix, commonPrefixLength, compareTo, copyTo, copyTo, getInt, getInt, getLong, getLong, hasLeadingZero, hasLeadingZeroByte, isEmpty, isZero, not, numberOfLeadingZeroBytes, numberOfLeadingZeros, numberOfTrailingZeroBytes, or, or, reverse, shiftLeft, shiftRight, slice, toArray, toArray, toArrayUnsafe, toBase64String, toEllipsisHexString, toFastHex, toHexString, toInt, toLong, toQuantityHexString, toShortHexString, toUnprefixedHexString, toUnsignedBigInteger, toUnsignedBigInteger, trimLeadingZeros, trimTrailingZeros, update, xor, xorMethods inherited from interface org.apache.tuweni.bytes.Bytes32
and, not, or, shiftLeft, shiftRight, size, xorMethods inherited from interface org.apache.tuweni.units.bigints.UInt256Value
addExact, addExact, addSafe, addSafe, fitsInt, fitsInt, fitsLong, fitsLong, greaterOrEqualThan, greaterThan, intValue, lessOrEqualThan, lessThan, plus, plus, subtractExact, subtractExact, toBigInteger, toBigInteger, toDecimalString, toInt, toSignedBigInteger, toSignedBigInteger
-
Field Details
-
ZERO
-
-
Method Details
-
fromEth
Return aWeicontaining the specified value from an ETH- Parameters:
ethValue- the value in eth- Returns:
- A
Weicontaining the specified value. - Throws:
IllegalArgumentException- If the value is negative.
-
valueOf
Return aWeicontaining the specified value.- Parameters:
value- The value to create aWeifor.- Returns:
- A
Weicontaining the specified value. - Throws:
IllegalArgumentException- If the value is negative.
-
valueOf
Return aWeicontaining the specified value.- Parameters:
value- The value to create aWeifor.- Returns:
- A
Weicontaining the specified value. - Throws:
IllegalArgumentException- If the value is negative.
-
valueOf
Return aWeicontaining the specified value.- Parameters:
value- The value to create aWeifor.- Returns:
- A
Weicontaining the specified value. - Throws:
IllegalArgumentException- If the value is negative.
-