-
- All Implemented Interfaces:
-
io.kjson.JSONPrimitive,io.kjson.JSONValue,java.io.Serializable
public final class JSONInt extends JSONNumber implements JSONPrimitive<Int>
A JSON integer value (up to 32 bits).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classJSONInt.Companion
-
Field Summary
Fields Modifier and Type Field Description private final IntegerasIntprivate final IntegerasIntOrNullprivate final LongasLongprivate final LongasLongOrNullprivate final BigDecimalasDecimalprivate final BigDecimalasDecimalOrNullprivate final Integervalue
-
Method Summary
Modifier and Type Method Description final IntegergetAsInt()final IntegergetAsIntOrNull()final LonggetAsLong()final LonggetAsLongOrNull()final BigDecimalgetAsDecimal()final BigDecimalgetAsDecimalOrNull()IntegergetValue()UnitappendTo(Appendable a)Unitoutput(IntConsumer out)UnitcoOutput(SuspendFunction1<Character, Unit> out)BooleanisIntegral()BooleanisLong()BooleanisInt()BooleanisShort()BooleanisByte()BooleanisULong()BooleanisUInt()BooleanisUShort()BooleanisUByte()BooleanisZero()BooleanisNegative()BooleanisPositive()BooleanisNotZero()BooleanisNotNegative()BooleanisNotPositive()DoubletoDouble()FloattoFloat()LongtoLong()IntegertoInt()CharactertoChar()ShorttoShort()BytetoByte()BigDecimaltoDecimal()ULongtoULong()UInttoUInt()UShorttoUShort()UBytetoUByte()Booleanequals(Object other)IntegerhashCode()StringtoString()-
-
Constructor Detail
-
JSONInt
JSONInt(Integer value)
-
-
Method Detail
-
getAsIntOrNull
final Integer getAsIntOrNull()
-
getAsLongOrNull
final Long getAsLongOrNull()
-
getAsDecimal
final BigDecimal getAsDecimal()
-
getAsDecimalOrNull
final BigDecimal getAsDecimalOrNull()
-
appendTo
Unit appendTo(Appendable a)
-
output
Unit output(IntConsumer out)
-
coOutput
Unit coOutput(SuspendFunction1<Character, Unit> out)
-
isIntegral
Boolean isIntegral()
-
isNegative
Boolean isNegative()
-
isPositive
Boolean isPositive()
-
isNotNegative
Boolean isNotNegative()
-
isNotPositive
Boolean isNotPositive()
-
toDecimal
BigDecimal toDecimal()
-
-
-
-