Trait

kantan.codecs

Decoder

Related Doc: package codecs

Permalink

trait Decoder[E, D, F, R[DD] <: Decoder[E, DD, F, R]] extends Serializable

Parent trait for all type classes used to decode a useful type from an encoded value.

E

encoded type - what to decode from.

D

decoded type - what to decode to.

F

failure type - how to represent errors.

R

implementation type - what will be returned by the various map operations.

Self Type
R[D]
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Decoder
  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 copy[DD](f: (E) ⇒ Result[F, DD]): R[DD]

    Permalink

    Clones this decoder to create a new one with a different decoding function.

    Clones this decoder to create a new one with a different decoding function.

    This is not meant to be called directly. If you feel you need to, you're probably looking for map.

    Attributes
    protected
  2. abstract def decode(e: E): Result[F, D]

    Permalink

    Decodes encoded data.

    Decodes encoded data.

    This method is safe, in that it won't throw for run-of-the-mill errors. Unrecoverable errors such as out of memory exceptions are still thrown, but that's considered valid exceptional cases, where incorrectly encoded data is just... normal.

    Callers that wish to fail fast and fail hard can use the unsafeDecode method instead.

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. def map[DD](f: (D) ⇒ DD): R[DD]

    Permalink

    Creates a new Decoder instance that applies the specified function after decoding.

    Creates a new Decoder instance that applies the specified function after decoding.

    This is convenient when building Decoder instances: when writing a Decoder[E, D, F, R], it often happens that you already have an instance of Decoder[E, DD, F, R] and a D ⇒ DD.

  13. def mapResult[DD](f: (D) ⇒ Result[F, DD]): R[DD]

    Permalink

    Creates a new Decoder instance that applies the specified function after decoding.

    Creates a new Decoder instance that applies the specified function after decoding.

    This is similar to map, but is used for these cases when the transformation function is unsafe - you have a Decoder[String] and want to turn it into a Decoder[Int], for example.

  14. final def ne(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef
  18. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  19. def unsafeDecode(e: E): D

    Permalink

    Decodes encoded data unsafely.

    Decodes encoded data unsafely.

    The main difference between this and decode is that the former throws exceptions when errors occur where the later safely encodes error conditions in its return type.

  20. final def wait(): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. 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