fabric.rw

package fabric.rw

Type members

Classlikes

class Asable(value: Value)
trait ClassRW[T] extends ReaderWriter[T]

ClassRW provides convenience functionality to simplify class mapping with ReaderWriter

ClassRW provides convenience functionality to simplify class mapping with ReaderWriter

trait CompileRW
Companion
object
object CompileRW
Companion
class
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
object ReaderWriter
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

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 Params
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 Params
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 Params
value

the singleton value to use

Inherited methods

inline def ccRW[T <: Product](using ProductOf[T]): ReaderWriter[T]
Inherited from
CompileRW
inline def fromMap[T <: Product](map: Map[String, Value])(using p: ProductOf[T]): T
Inherited from
CompileRW
inline def fromMapElems[A <: Product, T <: Tuple, L <: Tuple](map: Map[String, Value], 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, Value]
Inherited from
CompileRW
inline def toMapElems[A <: Product, T <: Tuple, L <: Tuple](a: A, index: Int): Map[String, Value]
Inherited from
CompileRW