Class/Object

io.circe

JsonNumber

Related Docs: object JsonNumber | package circe

Permalink

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
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def toBigDecimal: BigDecimal

    Permalink

    Return this number as a scala.math.BigDecimal.

  2. abstract def toDouble: Double

    Permalink

    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]

    Permalink

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

  4. abstract def truncateToLong: Long

    Permalink

    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: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink

    Type-safe inequality for JsonNumber.

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. def ===(that: JsonNumber): Boolean

    Permalink

    Type-safe equality for JsonNumber.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def asJson: Option[Json]

    Permalink

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

  8. def asJsonOrNull: Json

    Permalink

    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.

  9. def asJsonOrString: Json

    Permalink

    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.

  10. def clone(): AnyRef

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

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

    Permalink

    Universal equality derived from our type-safe equality.

    Universal equality derived from our type-safe equality.

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

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

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

    Permalink

    Hashing that is consistent with our universal equality.

    Hashing that is consistent with our universal equality.

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

    Permalink

    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
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isNaN: Boolean

    Permalink

    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
  19. def isReal: Boolean

    Permalink

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

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

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

    Permalink
    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  24. def toBigInt: Option[BigInt]

    Permalink

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

  25. def toByte: Option[Byte]

    Permalink

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

  26. def toInt: Option[Int]

    Permalink

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

  27. def toShort: Option[Short]

    Permalink

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

  28. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  29. def truncateToBigInt: BigInt

    Permalink

    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.

  30. def truncateToByte: Byte

    Permalink

    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.

  31. def truncateToInt: Int

    Permalink

    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.

  32. def truncateToShort: Short

    Permalink

    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.

  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped