Packages

t

kantan.codecs.strings.java8

TimeDecoderCompanion

trait TimeDecoderCompanion[E, F, T] extends AnyRef

Provides useful methods for a java8 time decoder companions.

Usage note: when declaring default implicit instances, be sure to wrap them in an export.Exported. Otherwise, custom instances and default ones are very likely to conflict.

Source
TimeDecoderCompanion.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeDecoderCompanion
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def decoderFrom[D](d: StringDecoder[D]): Decoder[E, D, F, T]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def defaultInstantDecoder: Decoder[E, Instant, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultInstantDecoder
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[Instant] = Right(2000-01-01T12:00:00Z)
  7. def defaultLocalDateDecoder: Decoder[E, LocalDate, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultLocalDateDecoder
           |   .decode("2000-01-01")
      res1: StringResult[LocalDate] = Right(2000-01-01)
  8. def defaultLocalDateTimeDecoder: Decoder[E, LocalDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultLocalDateTimeDecoder
           |   .decode("2000-01-01T12:00:00.000")
      res1: StringResult[LocalDateTime] = Right(2000-01-01T12:00)
  9. def defaultLocalTimeDecoder: Decoder[E, LocalTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultLocalTimeDecoder
           |   .decode("12:00:00.000")
      res1: StringResult[LocalTime] = Right(12:00)
  10. def defaultOffsetDateTimeDecoder: Decoder[E, OffsetDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultOffsetDateTimeDecoder
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[OffsetDateTime] = Right(2000-01-01T12:00Z)
  11. def defaultZonedDateTimeDecoder: Decoder[E, ZonedDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.defaultZonedDateTimeDecoder
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[ZonedDateTime] = Right(2000-01-01T12:00Z)
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def instantDecoder(format: Format): Decoder[E, Instant, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.instantDecoder(Format(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC)))
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[Instant] = Right(2000-01-01T12:00:00Z)
  18. def instantDecoder(format: => DateTimeFormatter): Decoder[E, Instant, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.instantDecoder(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC))
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[Instant] = Right(2000-01-01T12:00:00Z)
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def localDateDecoder(format: Format): Decoder[E, LocalDate, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localDateDecoder(fmt"yyyy-MM-DD")
           |   .decode("2000-01-01")
      res1: StringResult[LocalDate] = Right(2000-01-01)
  21. def localDateDecoder(format: => DateTimeFormatter): Decoder[E, LocalDate, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localDateDecoder(DateTimeFormatter.ISO_LOCAL_DATE)
           |   .decode("2000-01-01")
      res1: StringResult[LocalDate] = Right(2000-01-01)
  22. def localDateTimeDecoder(format: Format): Decoder[E, LocalDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localDateTimeDecoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSS")
           |   .decode("2000-01-01T12:00:00.000")
      res1: StringResult[LocalDateTime] = Right(2000-01-01T12:00)
  23. def localDateTimeDecoder(format: => DateTimeFormatter): Decoder[E, LocalDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localDateTimeDecoder(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
           |   .decode("2000-01-01T12:00:00.000")
      res1: StringResult[LocalDateTime] = Right(2000-01-01T12:00)
  24. def localTimeDecoder(format: Format): Decoder[E, LocalTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localTimeDecoder(fmt"HH:mm:ss.SSS")
           |   .decode("12:00:00.000")
      res1: StringResult[LocalTime] = Right(12:00)
  25. def localTimeDecoder(format: => DateTimeFormatter): Decoder[E, LocalTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.localTimeDecoder(DateTimeFormatter.ISO_LOCAL_TIME)
           |   .decode("12:00:00.000")
      res1: StringResult[LocalTime] = Right(12:00)
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. def offsetDateTimeDecoder(format: Format): Decoder[E, OffsetDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.offsetDateTimeDecoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSXX")
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[OffsetDateTime] = Right(2000-01-01T12:00Z)
  30. def offsetDateTimeDecoder(format: => DateTimeFormatter): Decoder[E, OffsetDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.offsetDateTimeDecoder(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[OffsetDateTime] = Right(2000-01-01T12:00Z)
  31. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  32. def toString(): String
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  36. def zonedDateTimeDecoder(format: Format): Decoder[E, ZonedDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.zonedDateTimeDecoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSzz")
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[ZonedDateTime] = Right(2000-01-01T12:00Z)
  37. def zonedDateTimeDecoder(format: => DateTimeFormatter): Decoder[E, ZonedDateTime, F, T]

    Creates a Decoder instance that uses the specified format.

    Creates a Decoder instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeDecoderCompanion[String, DecodeError, codecs.type] {
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> Foo.zonedDateTimeDecoder(DateTimeFormatter.ISO_ZONED_DATE_TIME)
           |   .decode("2000-01-01T12:00:00.000Z")
      res1: StringResult[ZonedDateTime] = Right(2000-01-01T12:00Z)

Inherited from AnyRef

Inherited from Any

Ungrouped