trait Param[Typeclass[_], Type] extends ReadOnlyParam[Typeclass, Type]
represents a parameter of a case class
- Typeclass
type constructor for the typeclass being derived
- Type
generic type of this parameter
- Alphabetic
- By Inheritance
- Param
- ReadOnlyParam
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type PType
the type of the parameter being represented
the type of the parameter being represented
For example, for a case class,
case class Person(name: String, age: Int)
the ReadOnlyParam instance corresponding to theage
parameter would have a PType equal to the type scala.Int. However, in practice, this type will never be universally quantified.case class Person(name: String, age: Int) the
age
parameter would have a PType equal to the type scala.Int. However, in practice, this type will never be universally quantified.- Definition Classes
- ReadOnlyParam
Abstract Value Members
- abstract def annotationsArray: Array[Any]
- Definition Classes
- ReadOnlyParam
- abstract def default: Option[PType]
provides the default value for this parameter, as defined in the case class constructor
- abstract def dereference(param: Type): PType
dereferences a value of the case class type,
Type
, to access the value of the parameter being representeddereferences a value of the case class type,
Type
, to access the value of the parameter being representedWhen programming generically, against an unknown case class, with unknown parameter names and types, it is not possible to directly access the parameter values without reflection, which is undesirable. This method, whose implementation is provided by the Magnolia macro, will dereference a case class instance to access the parameter corresponding to this ReadOnlyParam.
Whilst the type of the resultant parameter value cannot be universally known at the use, its type will be existentially quantified on this ReadOnlyParam instance, and the return type of the corresponding
typeclass
method will be existentially quantified on the same value. This is sufficient for the compiler to determine that the two values are compatible, and the value may be applied to the typeclass (in whatever way that particular typeclass provides).- param
the instance of the case class to be dereferenced
- returns
the parameter value
- Definition Classes
- ReadOnlyParam
- abstract def index: Int
- Definition Classes
- ReadOnlyParam
- abstract def label: String
the name of the parameter
the name of the parameter
- Definition Classes
- ReadOnlyParam
- abstract def repeated: Boolean
flag indicating a repeated (aka.
flag indicating a repeated (aka. vararg) parameter
For example, for a case class,
case class Account(id: String, emails: String*)
the ReadOnlyParam instance corresponding to theemails
parameter would berepeated
and have a PType equal to the typeSeq[String]
. Note that only the last parameter of a case class can be repeated.case class Account(id: String, emails: String*) corresponding to the
emails
parameter would berepeated
and have a PType equal to the typeSeq[String]
. Note that only the last parameter of a case class can be repeated.- Definition Classes
- ReadOnlyParam
- abstract def typeAnnotationsArray: Array[Any]
- Definition Classes
- ReadOnlyParam
- abstract def typeName: TypeName
the TypeName of the parameter
the TypeName of the parameter
This is the full name information for the type of the parameter.
- Definition Classes
- ReadOnlyParam
- abstract def typeclass: Typeclass[PType]
the typeclass instance associated with this parameter
the typeclass instance associated with this parameter
This is the instance of the type
Typeclass[PType]
which will have been discovered by implicit search, or derived by Magnolia.Its type is existentially quantified on this ReadOnlyParam instance, and depending on the nature of the particular typeclass, it may either accept or produce types which are also existentially quantified on this same ReadOnlyParam instance.
- Definition Classes
- ReadOnlyParam
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def annotations: Seq[Any]
a sequence of objects representing all of the annotations from the param implementation
a sequence of objects representing all of the annotations from the param implementation
For efficiency, this sequence is implemented by an
Array
, but upcast to a scala.collection.Seq to hide the mutable collection API.- Definition Classes
- ReadOnlyParam
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def inheritedAnnotations: Seq[Any]
a sequence of objects representing all of the annotations inherited from the param definition on base class/trait
a sequence of objects representing all of the annotations inherited from the param definition on base class/trait
For efficiency, this sequence is implemented by an
Array
, but upcast to a scala.collection.Seq to hide the mutable collection API.- Definition Classes
- ReadOnlyParam
- def inheritedAnnotationsArray: Array[Any]
- Definition Classes
- ReadOnlyParam
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Param → ReadOnlyParam → AnyRef → Any
- final def typeAnnotations: Seq[Any]
a sequence of objects representing all of the type annotations on the param
a sequence of objects representing all of the type annotations on the param
For efficiency, this sequence is implemented by an
Array
, but upcast to a scala.collection.Seq to hide the mutable collection API.- Definition Classes
- ReadOnlyParam
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated