case class JsDateTime(value: LocalDateTime) extends JsValue with Ordered[JsDateTime] with Product with Serializable
An immutable date-time without a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30. Although LocalTime/JsTime can be represented to nanosecond precision, a JSON serializer may not store the nano-of-second field to save the space. To preserve the high precision of time, JsTimestamp should be employed.
- Alphabetic
- By Inheritance
- JsDateTime
- Serializable
- Product
- Equals
- Ordered
- Comparable
- JsValue
- Dynamic
- AnyRef
- Any
- by json2DateTime
- by orderingToOrdered
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new JsDateTime(value: LocalDateTime)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from JsDateTime toany2stringadd[JsDateTime] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (JsDateTime, B)
- Implicit
- This member is added by an implicit conversion from JsDateTime toArrowAssoc[JsDateTime] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- def <(that: JsDateTime): Boolean
- Definition Classes
- Ordered
- def <=(that: JsDateTime): Boolean
- Definition Classes
- Ordered
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def >(that: JsDateTime): Boolean
- Definition Classes
- Ordered
- def >=(that: JsDateTime): Boolean
- Definition Classes
- Ordered
- def adjustInto(arg0: Temporal): Temporal
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → TemporalAdjuster
- def apply(range: Range): JsArray
- Definition Classes
- JsValue
- def apply(start: Int, end: Int, step: Int): JsArray
- Definition Classes
- JsValue
- def apply(start: Int, end: Int): JsArray
- Definition Classes
- JsValue
- def apply(index: Int): JsValue
- Definition Classes
- JsValue
- def apply(key: String): JsValue
- Definition Classes
- JsValue
- def applyDynamic(key: String)(index: Int): JsValue
- Definition Classes
- JsValue
- def asBoolean: Boolean
- Definition Classes
- JsValue
- def asDate: LocalDate
- Definition Classes
- JsDateTime → JsValue
- def asDateTime: LocalDateTime
- Definition Classes
- JsDateTime → JsValue
- def asDecimal: BigDecimal
- Definition Classes
- JsValue
- def asDouble: Double
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
- Definition Classes
- JsDateTime → JsValue
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asInt: Int
- Definition Classes
- JsValue
- def asLong: Long
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
Converts this date-time to the number of seconds from the epoch of 1970-01-01T00:00:00Z.
- Definition Classes
- JsDateTime → JsValue
- def asTime: LocalTime
- Definition Classes
- JsDateTime → JsValue
- def asTimestamp: Timestamp
- Definition Classes
- JsDateTime → JsValue
- def atOffset(arg0: ZoneOffset): OffsetDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def atZone(arg0: ZoneId): ZonedDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compactPrint: String
- Definition Classes
- JsValue
- def compare(that: JsDateTime): Int
- Definition Classes
- JsDateTime → Ordered
- def compareTo(that: JsDateTime): Int
- Definition Classes
- Ordered → Comparable
- def ensuring(cond: (JsDateTime) => Boolean, msg: => Any): JsDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toEnsuring[JsDateTime] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (JsDateTime) => Boolean): JsDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toEnsuring[JsDateTime] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): JsDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toEnsuring[JsDateTime] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): JsDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toEnsuring[JsDateTime] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(o: Any): Boolean
- Definition Classes
- JsDateTime → Equals → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def format(arg0: DateTimeFormatter): String
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def get(key: String): Option[JsValue]
- Definition Classes
- JsValue
- def getChronology(): Chronology
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- ChronoLocalDateTime
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getDayOfMonth(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getDayOfWeek(): DayOfWeek
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getDayOfYear(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getHour(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getLong(arg0: TemporalField): Long
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → TemporalAccessor
- def getMinute(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getMonth(): Month
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getMonthValue(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getNano(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getSecond(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def getYear(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def hashCode(): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → AnyRef → Any
- def isAfter(arg0: ChronoLocalDateTime[_ <: AnyRef]): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def isBefore(arg0: ChronoLocalDateTime[_ <: AnyRef]): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def isEqual(arg0: ChronoLocalDateTime[_ <: AnyRef]): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isSupported(arg0: TemporalUnit): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def isSupported(arg0: TemporalField): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → TemporalAccessor
- def minus(arg0: Long, arg1: TemporalUnit): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def minus(arg0: TemporalAmount): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def minusDays(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusHours(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusMinutes(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusMonths(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusNanos(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusSeconds(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusWeeks(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def minusYears(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def plus(arg0: Long, arg1: TemporalUnit): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def plus(arg0: TemporalAmount): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def plusDays(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusHours(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusMinutes(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusMonths(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusNanos(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusSeconds(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusWeeks(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def plusYears(arg0: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def prettyPrint: String
- Definition Classes
- JsValue
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def query[R <: AnyRef](arg0: TemporalQuery[R]): R
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → TemporalAccessor
- def range(arg0: TemporalField): ValueRange
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → TemporalAccessor
- def remove(index: Int): JsValue
- Definition Classes
- JsValue
- def remove(key: String): Option[JsValue]
- Definition Classes
- JsValue
- def selectDynamic(key: String): JsValue
- Definition Classes
- JsValue
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toEpochSecond(arg0: ZoneOffset): Long
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- ChronoLocalDateTime
- def toInstant(arg0: ZoneOffset): Instant
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- ChronoLocalDateTime
- def toLocalDate(): LocalDate
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def toLocalTime(): LocalTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime
- def toString(): String
The output will be one of the following ISO-8601 formats:
The output will be one of the following ISO-8601 formats:
- uuuu-MM-dd'T'HH:mm
- uuuu-MM-dd'T'HH:mm:ss
- uuuu-MM-dd'T'HH:mm:ss.SSS
- uuuu-MM-dd'T'HH:mm:ss.SSSSSS
- uuuu-MM-dd'T'HH:mm:ss.SSSSSSSSS
The format used will be the shortest that outputs the full value of the time where the omitted parts are implied to be zero.
- Definition Classes
- JsDateTime → JsValue → AnyRef → Any
- def truncatedTo(arg0: TemporalUnit): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def until(arg0: Temporal, arg1: TemporalUnit): Long
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → Temporal
- def update(index: Int, value: JsValue): JsValue
- Definition Classes
- JsValue
- def update(key: String, value: JsValue): JsValue
- Definition Classes
- JsValue
- def updateDynamic(index: Int)(value: JsValue): JsValue
- Definition Classes
- JsValue
- def updateDynamic(key: String)(value: JsValue): JsValue
- Definition Classes
- JsValue
- val value: LocalDateTime
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def with(arg0: TemporalField, arg1: Long): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def with(arg0: TemporalAdjuster): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Temporal
- def withDayOfMonth(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withDayOfYear(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withHour(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withMinute(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withMonth(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withNano(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withSecond(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
- def withYear(arg0: Int): LocalDateTime
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Definition Classes
- LocalDateTime
Shadowed Implicit Value Members
- def <(that: JsDateTime): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).<(that)
- Definition Classes
- Ordered
- def <=(that: JsDateTime): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).<=(that)
- Definition Classes
- Ordered
- def >(that: JsDateTime): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).>(that)
- Definition Classes
- Ordered
- def >=(that: JsDateTime): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).>=(that)
- Definition Classes
- Ordered
- def compare(that: JsDateTime): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).compare(that)
- Definition Classes
- Ordered
- def compareTo(arg0: ChronoLocalDateTime[_ <: AnyRef]): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: LocalDateTime).compareTo(arg0)
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → Comparable
- def compareTo(that: JsDateTime): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toOrdered[JsDateTime] performed by method orderingToOrdered in scala.math.Ordered.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: Ordered[JsDateTime]).compareTo(that)
- Definition Classes
- Ordered → Comparable
- def equals(arg0: AnyRef): Boolean
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: LocalDateTime).equals(arg0)
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → AnyRef → Any
- def get(arg0: TemporalField): Int
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: LocalDateTime).get(arg0)
- Definition Classes
- LocalDateTime → TemporalAccessor
- def toString(): String
- Implicit
- This member is added by an implicit conversion from JsDateTime toLocalDateTime performed by method json2DateTime in smile.json.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(jsDateTime: LocalDateTime).toString()
- Definition Classes
- LocalDateTime → ChronoLocalDateTime → AnyRef → Any
Deprecated Value Members
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from JsDateTime toStringFormat[JsDateTime] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (JsDateTime, B)
- Implicit
- This member is added by an implicit conversion from JsDateTime toArrowAssoc[JsDateTime] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages,
JSON has only types of string, number, boolean, object, array, and null. This library includes additional types such as date, int, long, double, counter, binary, UUID, ObjectId (as in BSON), etc.
It is very easy to parse a JSON object:
The interpolator
json
parse a string toJsObject
. To parse an array, use the interpolatorjsan
toJsArray
. It is also okay to embed variable references directly in processed string literals.If the string is not a JSON object but any other valid JSON expression, one may use parseJson method to convert the string to a
JsValue
."1".parseJson
The json interpolator can only be applied to string literals. If you want to parse a string variable, the
parseJson
method can always be employed. If you know the string contains a JSON object, you may also use the methodparseJsObject
.To serialize a JSON value (of type JsValue) in compact mode, you can just use
toString
. To pretty print, use the methodprettyPrint
.With a
JsObject
orJsArray
, you can refer to the individual elements with a variation of array syntax, like this:Note that we follow Scala's array access convention by
()
rather than[]
in JavaScript.Besides, you can use the dot notation to access its fields/elements just like in JavaScript:
doc.store.bicycle.color doc.store.book(0).author
It is worth noting that we didn't define the type/schema of the document while Scala is a strong type language. In other words, we have both the type safe features of strong type language and the flexibility of dynamic language in this JSON library.
If you try to access a non-exist field,
JsUndefined
is returned.Although there are already several nice JSON libraries for Scala, the JSON objects are immutable by design, which is a natural choice for a functional language. For database, however, data mutation is necessary. Therefore,
JsObject
andJsArray
are mutable data structures. You can set/add a field just like in JavaScript:json.store.bicycle.color = "green"
To delete a field from
JsObject
, use remove method:It is same as setting it
JsUndefined
:doc.store.book(0).price = `JsUndefined`
To delete an element from
JsArray
, the remove method will effectively remove it from the array. However, setting an element to undefined doesn't reduce the array size.It is also possible to append an element or another array to
JsArray
:Common iterative operations such as
foreach
,map
,reduce
can be applied toJsArray
too.doc.store.book.asInstanceOf[JsArray].foreach { book => println(book.price) }
Because Scala is a static language, it is impossible to know
doc.store.book
is an array at compile time. So it is typed as genericJsValue
, which is the parent type of specific JSON data types. Therefore, we useasInstanceOf[JsArray]
to convert it toJsArray
in order to useforeach
.