Package ru.tinkoff.kora.common.util
Class Size
java.lang.Object
ru.tinkoff.kora.common.util.Size
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumBinary format have letter 'i' in its name Decimal and Binary Prefixes -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static Sizestatic SizeofBytesBinary(long bytes) Converts bytes to binary format Decimal and Binary Prefixesstatic SizeofBytesDecimal(long bytes) Converts bytes to decimal format Decimal and Binary Prefixesstatic SizelongtoBytes()toString()type()longdoubledoublevalueRounded(int scale)
-
Method Details
-
valueExact
public long valueExact()- Returns:
- exact even value of current size type
-
valueRounded
public double valueRounded()- Returns:
- value of current size type round to scale 2
-
valueRounded
public double valueRounded(int scale) -
type
-
toBytes
public long toBytes() -
to
-
of
-
ofBytesBinary
Converts bytes to binary format Decimal and Binary Prefixes- Parameters:
bytes- bytes to convert to size- Returns:
- size in binary format
- Throws:
IllegalArgumentException
-
ofBytesDecimal
Converts bytes to decimal format Decimal and Binary Prefixes- Parameters:
bytes- bytes to convert to size- Returns:
- size in decimal format
- Throws:
IllegalArgumentException
-
parse
- Throws:
IllegalArgumentException
-
equals
-
hashCode
public int hashCode() -
toString
-