aboutsummaryrefslogtreecommitdiff
path: root/core/shared/src/main/scala/interface.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/shared/src/main/scala/interface.scala')
-rw-r--r--core/shared/src/main/scala/interface.scala11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/shared/src/main/scala/interface.scala b/core/shared/src/main/scala/interface.scala
index b06f350..f0f104c 100644
--- a/core/shared/src/main/scala/interface.scala
+++ b/core/shared/src/main/scala/interface.scala
@@ -104,7 +104,7 @@ trait Param[Typeclass[_], Type] {
* @tparam Typeclass type constructor for the typeclass being derived
* @tparam Type generic type of this parameter */
abstract class CaseClass[Typeclass[_], Type] private[magnolia] (
- val typeName: String,
+ val typeName: TypeName,
val isObject: Boolean,
val isValueClass: Boolean,
parametersArray: Array[Param[Typeclass, Type]]
@@ -157,7 +157,7 @@ abstract class CaseClass[Typeclass[_], Type] private[magnolia] (
* @param subtypesArray an array of [[Subtype]] instances for each subtype in the sealed trait
* @tparam Typeclass type constructor for the typeclass being derived
* @tparam Type generic type of this parameter */
-final class SealedTrait[Typeclass[_], Type](val typeName: String,
+final class SealedTrait[Typeclass[_], Type](val typeName: TypeName,
subtypesArray: Array[Subtype[Typeclass, Type]]) {
/** a sequence of all the subtypes of this sealed trait */
@@ -182,3 +182,10 @@ final class SealedTrait[Typeclass[_], Type](val typeName: String,
rec(0)
}
}
+
+/**
+ * Provides the different parts of a type's class name.
+ */
+final case class TypeName(ownerName: String, short: String) {
+ def full: String = s"$ownerName.$short"
+} \ No newline at end of file