Packages

t

kantan.codecs.strings.java8

TimeCodecCompanion

trait TimeCodecCompanion[E, F, T] extends TimeDecoderCompanion[E, F, T] with TimeEncoderCompanion[E, T]

Provides useful methods for a java8 time codec 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
TimeCodecCompanion.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TimeCodecCompanion
  2. TimeEncoderCompanion
  3. TimeDecoderCompanion
  4. AnyRef
  5. 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]
    Definition Classes
    TimeDecoderCompanion
  2. abstract def encoderFrom[D](d: StringEncoder[D]): Encoder[E, D, T]
    Definition Classes
    TimeEncoderCompanion

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.

    Definition Classes
    TimeDecoderCompanion
    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 defaultInstantEncoder: Encoder[E, Instant, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultInstantEncoder
           |   .encode(Instant.parse("2000-01-01T12:00:00.000Z"))
      res1: String = 2000-01-01T12:00:00Z
  8. def defaultLocalDateDecoder: Decoder[E, LocalDate, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Definition Classes
    TimeDecoderCompanion
    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)
  9. def defaultLocalDateEncoder: Encoder[E, LocalDate, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultLocalDateEncoder
           |   .encode(LocalDate.of(2000, 1, 1))
      res1: String = 2000-01-01
  10. def defaultLocalDateTimeDecoder: Decoder[E, LocalDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Definition Classes
    TimeDecoderCompanion
    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)
  11. def defaultLocalDateTimeEncoder: Encoder[E, LocalDateTime, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultLocalDateTimeEncoder
           |   .encode(LocalDateTime.of(2000, 1, 1, 12, 0, 0, 0))
      res1: String = 2000-01-01T12:00:00
  12. def defaultLocalTimeDecoder: Decoder[E, LocalTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Definition Classes
    TimeDecoderCompanion
    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)
  13. def defaultLocalTimeEncoder: Encoder[E, LocalTime, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultLocalTimeEncoder
           |   .encode(LocalTime.of(12, 0, 0, 0))
      res1: String = 12:00:00
  14. def defaultOffsetDateTimeDecoder: Decoder[E, OffsetDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Definition Classes
    TimeDecoderCompanion
    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)
  15. def defaultOffsetDateTimeEncoder: Encoder[E, OffsetDateTime, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultOffsetDateTimeEncoder
           |   .encode(OffsetDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00Z
  16. def defaultZonedDateTimeDecoder: Decoder[E, ZonedDateTime, F, T]

    Creates a Decoder instance using the default format.

    Creates a Decoder instance using the default format.

    Definition Classes
    TimeDecoderCompanion
    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)
  17. def defaultZonedDateTimeEncoder: Encoder[E, ZonedDateTime, T]

    Creates an Encoder instance using the default format.

    Creates an Encoder instance using the default format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.defaultZonedDateTimeEncoder
           |   .encode(ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00Z
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def instantCodec(format: Format): Codec[E, Instant, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.instantCodec(Format(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC)))
      
      scala> val encoded = codec.encode(Instant.parse("2000-01-01T12:00:00.000Z"))
      res1: String = 2000-01-01T12:00:00Z
      
      scala> codec.decode(encoded)
      res2: StringResult[Instant] = Right(2000-01-01T12:00:00Z)
  24. def instantCodec(format: => DateTimeFormatter): Codec[E, Instant, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.instantCodec(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC))
      
      scala> val encoded = codec.encode(Instant.parse("2000-01-01T12:00:00.000Z"))
      res1: String = 2000-01-01T12:00:00Z
      
      scala> codec.decode(encoded)
      res2: StringResult[Instant] = Right(2000-01-01T12:00:00Z)
  25. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  26. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  27. def instantEncoder(format: Format): Encoder[E, Instant, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.instantEncoder(Format(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC)))
           |   .encode(Instant.parse("2000-01-01T12:00:00.000Z"))
      res1: String = 2000-01-01T12:00:00Z
  28. def instantEncoder(format: => DateTimeFormatter): Encoder[E, Instant, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.instantEncoder(DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC))
           |   .encode(Instant.parse("2000-01-01T12:00:00.000Z"))
      res1: String = 2000-01-01T12:00:00Z
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def localDateCodec(format: Format): Codec[E, LocalDate, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localDateCodec(fmt"yyyy-MM-DD")
      
      scala> val encoded = codec.encode(LocalDate.of(2000, 1, 1))
      res1: String = 2000-01-01
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalDate] = Right(2000-01-01)
  31. def localDateCodec(format: => DateTimeFormatter): Codec[E, LocalDate, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localDateCodec(DateTimeFormatter.ISO_LOCAL_DATE)
      
      scala> val encoded = codec.encode(LocalDate.of(2000, 1, 1))
      res1: String = 2000-01-01
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalDate] = Right(2000-01-01)
  32. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  33. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  34. def localDateEncoder(format: Format): Encoder[E, LocalDate, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localDateEncoder(fmt"yyyy-MM-DD")
           |   .encode(LocalDate.of(2000, 1, 1))
      res1: String = 2000-01-01
  35. def localDateEncoder(format: => DateTimeFormatter): Encoder[E, LocalDate, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localDateEncoder(DateTimeFormatter.ISO_LOCAL_DATE)
           |   .encode(LocalDate.of(2000, 1, 1))
      res1: String = 2000-01-01
  36. def localDateTimeCodec(format: Format): Codec[E, LocalDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localDateTimeCodec(fmt"yyyy-MM-DD'T'HH:mm:ss.SSS")
      
      scala> val encoded = codec.encode(LocalDateTime.of(2000, 1, 1, 12, 0, 0, 0))
      res1: String = 2000-01-01T12:00:00.000
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalDateTime] = Right(2000-01-01T12:00)
  37. def localDateTimeCodec(format: => DateTimeFormatter): Codec[E, LocalDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localDateTimeCodec(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
      
      scala> val encoded = codec.encode(LocalDateTime.of(2000, 1, 1, 12, 0, 0, 0))
      res1: String = 2000-01-01T12:00:00.000
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalDateTime] = Right(2000-01-01T12:00)
  38. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  39. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  40. def localDateTimeEncoder(format: Format): Encoder[E, LocalDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localDateTimeEncoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSS")
           |   .encode(LocalDateTime.of(2000, 1, 1, 12, 0, 0, 0))
      res1: String = 2000-01-01T12:00:00.000
  41. def localDateTimeEncoder(format: => DateTimeFormatter): Encoder[E, LocalDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localDateTimeEncoder(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
           |   .encode(LocalDateTime.of(2000, 1, 1, 12, 0, 0, 0))
      res1: String = 2000-01-01T12:00:00
  42. def localTimeCodec(format: Format): Codec[E, LocalTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localTimeCodec(fmt"HH:mm:ss.SSS")
      
      scala> val encoded = codec.encode(LocalTime.of(12, 0, 0, 0))
      res1: String = 12:00:00.000
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalTime] = Right(12:00)
  43. def localTimeCodec(format: => DateTimeFormatter): Codec[E, LocalTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.localTimeCodec(DateTimeFormatter.ISO_LOCAL_TIME)
      
      scala> val encoded = codec.encode(LocalTime.of(12, 0, 0, 0))
      res1: String = 12:00:00.000
      
      scala> codec.decode(encoded)
      res2: StringResult[LocalTime] = Right(12:00)
  44. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  45. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  46. def localTimeEncoder(format: Format): Encoder[E, LocalTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localTimeEncoder(fmt"HH:mm:ss.SSS")
           |   .encode(LocalTime.of(12, 0, 0, 0))
      res1: String = 12:00:00.000
  47. def localTimeEncoder(format: => DateTimeFormatter): Encoder[E, LocalTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.localTimeEncoder(DateTimeFormatter.ISO_LOCAL_TIME)
           |   .encode(LocalTime.of(12, 0, 0, 0))
      res1: String = 12:00:00
  48. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  49. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  50. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  51. def offsetDateTimeCodec(format: Format): Codec[E, OffsetDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.offsetDateTimeCodec(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSXX")
      
      scala> val encoded = codec.encode(OffsetDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
      
      scala> codec.decode(encoded)
      res2: StringResult[OffsetDateTime] = Right(2000-01-01T12:00Z)
  52. def offsetDateTimeCodec(format: => DateTimeFormatter): Codec[E, OffsetDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.offsetDateTimeCodec(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
      
      scala> val encoded = codec.encode(OffsetDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
      
      scala> codec.decode(encoded)
      res2: StringResult[OffsetDateTime] = Right(2000-01-01T12:00Z)
  53. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  54. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  55. def offsetDateTimeEncoder(format: Format): Encoder[E, OffsetDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.offsetDateTimeEncoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSXX")
           |   .encode(OffsetDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
  56. def offsetDateTimeEncoder(format: => DateTimeFormatter): Encoder[E, OffsetDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.offsetDateTimeEncoder(DateTimeFormatter.ISO_OFFSET_DATE_TIME)
           |   .encode(OffsetDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00Z
  57. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  58. def toString(): String
    Definition Classes
    AnyRef → Any
  59. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  60. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  61. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  62. def zonedDateTimeCodec(format: Format): Codec[E, ZonedDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.zonedDateTimeCodec(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSzz")
      
      scala> val encoded = codec.encode(ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
      
      scala> codec.decode(encoded)
      res2: StringResult[ZonedDateTime] = Right(2000-01-01T12:00Z)
  63. def zonedDateTimeCodec(format: => DateTimeFormatter): Codec[E, ZonedDateTime, F, T]

    Creates a Codec instance that uses the specified format.

    Creates a Codec instance that uses the specified format.

    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeCodecCompanion[String, DecodeError, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           |   override def decoderFrom[D](d: StringDecoder[D]) = d
           | }
      
      scala> val codec = Foo.zonedDateTimeCodec(DateTimeFormatter.ISO_ZONED_DATE_TIME)
      
      scala> val encoded = codec.encode(ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
      
      scala> codec.decode(encoded)
      res2: StringResult[ZonedDateTime] = Right(2000-01-01T12:00Z)
  64. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  65. 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.

    Definition Classes
    TimeDecoderCompanion
    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)
  66. def zonedDateTimeEncoder(format: Format): Encoder[E, ZonedDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.zonedDateTimeEncoder(fmt"yyyy-MM-DD'T'HH:mm:ss.SSSzz")
           |   .encode(ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00.000Z
  67. def zonedDateTimeEncoder(format: => DateTimeFormatter): Encoder[E, ZonedDateTime, T]

    Creates an Encoder instance that uses the specified format.

    Creates an Encoder instance that uses the specified format.

    Definition Classes
    TimeEncoderCompanion
    Example:
    1. scala> import java.time._, format._
      scala> import kantan.codecs.strings._
      
      scala> object Foo extends TimeEncoderCompanion[String, codecs.type] {
           |   override def encoderFrom[D](e: StringEncoder[D]) = e
           | }
      
      scala> Foo.zonedDateTimeEncoder(DateTimeFormatter.ISO_ZONED_DATE_TIME)
           |   .encode(ZonedDateTime.of(2000, 1, 1, 12, 0, 0, 0, ZoneOffset.UTC))
      res1: String = 2000-01-01T12:00:00Z

Inherited from TimeEncoderCompanion[E, T]

Inherited from TimeDecoderCompanion[E, F, T]

Inherited from AnyRef

Inherited from Any

Ungrouped