constructs a new instance of the case class type
constructs a new instance of the case class type
Like construct this method is implemented by Magnolia and lets you construct case class instances generically in user code, without knowing their type concretely.
rawConstruct
, however, is more low-level in that it expects you to provide a Seq
containing all the field values for the case class type, in order and with the correct types.
contains the field values for the case class instance to be constructed, in order and with the correct types.
a new instance of the case class
IllegalArgumentException
if the size of paramValues
differs from the size of parameters
a sequence of objects representing all of the annotations on the case class
a sequence of objects representing all of the annotations on the case class
For efficiency, this sequence is implemented by an Array
, but upcast to a
scala.collection.Seq to hide the mutable collection API.
constructs a new instance of the case class type
constructs a new instance of the case class type
This method will be implemented by the Magnolia macro to make it possible to construct instances of case classes generically in user code, that is, without knowing their type concretely.
To construct a new case class instance, the method takes a lambda which defines how each parameter in the new case class should be constructed. See the Param class for more information on constructing parameter values from a Param instance.
lambda for converting a generic Param into the value to be used for this parameter in the construction of a new instance of the case class
a new instance of the case class
true only if this represents a case object rather than a case class
a sequence of Param objects representing all of the parameters in the case class
a sequence of Param objects representing all of the parameters in the case class
For efficiency, this sequence is implemented by an Array
, but upcast to a
scala.collection.Seq to hide the mutable collection API.
the name of the case class
represents a case class or case object and the context required to construct a new typeclass instance corresponding to it
Instances of CaseClass provide access to all of the parameters of the case class, the full name of the case class type, and a boolean to determine whether the type is a case class or case object.
type constructor for the typeclass being derived
generic type of this parameter