fabric.rw

package fabric.rw

Type members

Classlikes

implicit class Asable(value: Json)
trait ClassR[T] extends Reader[T]
trait ClassRW[T] extends ReaderWriter[T] with ClassR[T] with ClassW[T]

ClassRW provides convenience functionality to simplify class mapping with ReaderWriter

ClassRW provides convenience functionality to simplify class mapping with ReaderWriter

trait ClassW[T] extends Writer[T]
trait CompileRW
Companion:
object
object CompileRW
Companion:
class
implicit class Convertible[T](value: T)
trait Reader[T]

Reader provides a simple T => Value wrapper functionality

Reader provides a simple T => Value wrapper functionality

Companion:
object
object Reader
Companion:
class
trait ReaderWriter[T] extends Reader[T] with Writer[T]

ReaderWriter provides a single class representation of a Reader and Writer for the same type

ReaderWriter provides a single class representation of a Reader and Writer for the same type

Companion:
object
Companion:
class
trait Writer[T]

Writable provides a simple Value => T wrapper functionality

Writable provides a simple Value => T wrapper functionality

Companion:
object
object Writer
Companion:
class

Types

type RW[T] = ReaderWriter[T]

Value members

Concrete methods

def defaultGetType[P](p: P): String

Used by polyRW by default to getType using the class name with the first character lowercase

Used by polyRW by default to getType using the class name with the first character lowercase

def enumRW[T](fieldName: String, mapping: (String, T)*): ReaderWriter[T]

Convenience functionality for working with enumerations

Convenience functionality for working with enumerations

Value parameters:
fieldName

the field name to refer to in the Value

mapping

a mapping of key/value pairs representing the String in fieldName to the representative value

def polyRW[P](fieldName: String, getType: P => String)(matcher: PartialFunction[String, ReaderWriter[_ <: P]]): ReaderWriter[P]

Convenience functionality for working with polymorphic types

Convenience functionality for working with polymorphic types

Value parameters:
fieldName

the field name stored in the value (defaults to "type")

getType

a function to determine the field value from an instance (defaults to the class name with the first character lowercase - defaultGetType)

matcher

a matcher for field values to get the representative ReaderWriter for that type

def staticRW[T](value: T): ReaderWriter[T]

Convenience functionality to provide a static / singleton value that represents that type

Convenience functionality to provide a static / singleton value that represents that type

Value parameters:
value

the singleton value to use

Inherited methods

inline def ccR[T <: Product](using ProductOf[T]): Reader[T]
Inherited from:
CompileRW
inline def ccRW[T <: Product](using ProductOf[T]): ReaderWriter[T]
Inherited from:
CompileRW
inline def ccW[T <: Product](using ProductOf[T]): Writer[T]
Inherited from:
CompileRW
inline def fromMap[T <: Product](map: Map[String, Json])(using p: ProductOf[T]): T
Inherited from:
CompileRW
inline def fromMapElems[A <: Product, T <: Tuple, L <: Tuple](map: Map[String, Json], index: Int, arr: Array[Any], defaults: Map[String, Any]): Unit
Inherited from:
CompileRW
inline def getClassName[T]: String
Inherited from:
CompileRW
inline def getDefaultParams[T]: Map[String, AnyRef]
Inherited from:
CompileRW
inline def toMap[T <: Product](t: T)(using p: ProductOf[T]): Map[String, Json]
Inherited from:
CompileRW
inline def toMapElems[A <: Product, T <: Tuple, L <: Tuple](a: A, index: Int): Map[String, Json]
Inherited from:
CompileRW

Implicits

Implicits

final implicit def Asable(value: Json): Asable
final implicit def Convertible[T](value: T): Convertible[T]