Class

co.blocke.scalajack.typeadapter

BasicTypeAdapter

Related Doc: package typeadapter

Permalink

abstract class BasicTypeAdapter[V] extends TypeAdapterFactory with TypeAdapter[V]

This class is virtually identical to SimpleTypeAdapter, except... it uses == rather than =:= type compare types in the factory to see if this is the TypeAdapter being sought by Context.

This difference is because =:= matches children. Consider: type Phone = String case class( name:String, phone:Phone )

With =:= both name and phone (String and Phone) will match a PhoneTypeAdapter based on SimpleTypeAdapter. This is actually what you want if you haven't overridden Phone with its own TypeAdapter... it should default to the TypeAdapter of its base type.

But... if you did provide an override PhoneTypeAdapter you want the matching to be strict, hence ==. With strict matching String != Phone.

This means all TypeAdapter overrides for primitives should extend BasicTypeAdapter, not SimpleTypeAdapter.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BasicTypeAdapter
  2. TypeAdapter
  3. TypeAdapterFactory
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BasicTypeAdapter()(implicit valueTypeTag: scala.reflect.api.JavaUniverse.TypeTag[V])

    Permalink

Abstract Value Members

  1. abstract def read(reader: Reader): V

    Permalink
    Definition Classes
    TypeAdapter
  2. abstract def write(value: V, writer: Writer): Unit

    Permalink
    Definition Classes
    TypeAdapter

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. def andThen[U](f: BijectiveFunction[V, U]): TransformedTypeAdapter[V, U]

    Permalink
    Definition Classes
    TypeAdapter
  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def defaultValue: Option[V]

    Permalink
    Definition Classes
    TypeAdapter
  8. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  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. def resolved: TypeAdapter[V]

    Permalink
    Definition Classes
    TypeAdapter
  18. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  20. def typeAdapterOf[T](next: TypeAdapterFactory)(implicit context: Context, tt: scala.reflect.api.JavaUniverse.TypeTag[T]): TypeAdapter[T]

    Permalink
    Definition Classes
    BasicTypeAdapterTypeAdapterFactory
  21. def typeAdapterOf[T](implicit context: Context, tt: scala.reflect.api.JavaUniverse.TypeTag[T]): TypeAdapter[T]

    Permalink
    Definition Classes
    TypeAdapterFactory
  22. val valueType: scala.reflect.api.JavaUniverse.Type

    Permalink
  23. final def wait(): Unit

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

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

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

Inherited from TypeAdapter[V]

Inherited from TypeAdapterFactory

Inherited from AnyRef

Inherited from Any

Ungrouped