aboutsummaryrefslogtreecommitdiff
path: root/core/shared/src/main/scala/interface.scala
diff options
context:
space:
mode:
authorGeorgi Krastev <joro.kr.21@gmail.com>2017-11-29 12:36:04 +0100
committerGeorgi Krastev <joro.kr.21@gmail.com>2017-11-29 18:04:24 +0100
commite9b52248855f9252520a232b28a841ea382922a1 (patch)
tree2811ad3c3231d1656ae5d69412bc579abf8fbb07 /core/shared/src/main/scala/interface.scala
parent93ff9742cf8cd9f2c60986ff4f7af8d24e268b1f (diff)
downloadmagnolia-e9b52248855f9252520a232b28a841ea382922a1.tar.gz
magnolia-e9b52248855f9252520a232b28a841ea382922a1.tar.bz2
magnolia-e9b52248855f9252520a232b28a841ea382922a1.zip
Add support for repeated (vararg) parameters
Added a `Param.repeated` flag to `interface`.
Diffstat (limited to 'core/shared/src/main/scala/interface.scala')
-rw-r--r--core/shared/src/main/scala/interface.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/shared/src/main/scala/interface.scala b/core/shared/src/main/scala/interface.scala
index 02c1cc5..193a6f9 100644
--- a/core/shared/src/main/scala/interface.scala
+++ b/core/shared/src/main/scala/interface.scala
@@ -46,6 +46,17 @@ trait Param[Typeclass[_], Type] {
/** the name of the parameter */
def label: String
+ /** flag indicating a repeated (aka. vararg) parameter
+ *
+ * For example, for a case class,
+ * <pre>
+ * case class Account(id: String, emails: String*)
+ * </pre>
+ * the [[Param]] instance corresponding to the `emails` parameter would be `repeated` and have a
+ * [[PType]] equal to the type `Seq[String]`. Note that only the last parameter of a case class
+ * can be repeated. */
+ def repeated: Boolean
+
/** the typeclass instance associated with this parameter
*
* This is the instance of the type `Typeclass[PType]` which will have been discovered by