io.circe

JsonNumber

sealed abstract class JsonNumber extends Serializable

A JSON number with optimization by cases.

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. JsonNumber
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JsonNumber()

Abstract Value Members

  1. abstract def toBigDecimal: BigDecimal

    Return this number as a scala.math.BigDecimal.

  2. abstract def toDouble: Double

    Convert this number to its best scala.Double approximation.

    Convert this number to its best scala.Double approximation.

    Anything over Double.MaxValue will be rounded to Double.PositiveInfinity and anything below Double.MinValue is rounded to Double.NegativeInfinity.

  3. abstract def toLong: Option[Long]

    Return this number as a scala.Long if it's a valid scala.Long.

  4. abstract def truncateToLong: Long

    Truncate the number to a scala.Long.

    Truncate the number to a scala.Long.

    Truncation means that we round toward zero to the closest valid scala.Long. If the number is 1e99, for example, this will return Long.MaxValue.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def =!=(that: JsonNumber): Boolean

    Type-safe inequality for JsonNumber.

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def ===(that: JsonNumber): Boolean

    Type-safe equality for JsonNumber.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def asJson: Option[Json]

    Construct a JSON number if this is a valid JSON number.

  10. def asJsonOrNull: Json

    Construct a JSON number if this is a valid JSON number and a JSON null otherwise.

    Construct a JSON number if this is a valid JSON number and a JSON null otherwise.

    This matches the behaviour of most browsers, but it is a lossy operation as you can no longer distinguish between Double.NaN and infinity.

  11. def asJsonOrString: Json

    Construct a JSON number if this is a valid JSON number and a JSON string otherwise.

    Construct a JSON number if this is a valid JSON number and a JSON string otherwise.

    This allows a scala.Double to be losslessly encoded, but it is likely to need custom handling for interoperability with other JSON systems.

  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  14. def equals(that: Any): Boolean

    Universal equality derived from our type-safe equality.

    Universal equality derived from our type-safe equality.

    Definition Classes
    JsonNumber → AnyRef → Any
  15. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Hashing that is consistent with our universal equality.

    Hashing that is consistent with our universal equality.

    Definition Classes
    JsonNumber → AnyRef → Any
  18. def isInfinity: Boolean

    Return true if and only if this number wraps a scala.Double and is either Double.NegativeInfinity or Double.PositiveInfinity.

    Return true if and only if this number wraps a scala.Double and is either Double.NegativeInfinity or Double.PositiveInfinity.

    Attributes
    protected
  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def isNaN: Boolean

    Return true if and only if this number wraps a scala.Double and it is Double.NaN.

    Return true if and only if this number wraps a scala.Double and it is Double.NaN.

    Attributes
    protected
  21. def isReal: Boolean

    Return true if this is a valid real number (i.

    Return true if this is a valid real number (i.e. not infinity or Double.NaN).

    Attributes
    protected
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  26. def toBigInt: Option[BigInt]

    Return this number as a scala.math.BigInt if it is an integer.

  27. def toByte: Option[Byte]

    Return this number as a scala.Byte if it's a valid scala.Byte.

  28. def toInt: Option[Int]

    Return this number as an scala.Int if it's a valid scala.Int.

  29. def toShort: Option[Short]

    Return this number as a scala.Short if it's a valid scala.Short.

  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. def truncateToBigInt: BigInt

    Truncate the number to a scala.math.BigInt.

    Truncate the number to a scala.math.BigInt.

    Truncation means that we round toward zero to the closest scala.math.BigInt.

  32. def truncateToByte: Byte

    Truncate the number to a scala.Byte.

    Truncate the number to a scala.Byte.

    Truncation means that we round toward zero to the closest valid scala.Byte. If the number is 1e99, for example, this will return Byte.MaxValue.

  33. def truncateToInt: Int

    Truncate the number to an scala.Int.

    Truncate the number to an scala.Int.

    Truncation means that we round toward zero to the closest valid scala.Int. If the number is 1e99, for example, this will return Int.MaxValue.

  34. def truncateToShort: Short

    Truncate the number to a scala.Short.

    Truncate the number to a scala.Short.

    Truncation means that we round toward zero to the closest valid scala.Short. If the number is 1e99, for example, this will return Short.MaxValue.

  35. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped