aboutsummaryrefslogtreecommitdiff
path: root/core/shared/src/main/scala/interface.scala
diff options
context:
space:
mode:
authorJon Pretty <jon.pretty@propensive.com>2018-01-05 00:23:01 +0100
committerGitHub <noreply@github.com>2018-01-05 00:23:01 +0100
commitc2acc0fd2f4772ea1b6d3a59271fbe2d9063f69f (patch)
tree59539174a7683432ee437e2463ff5d7bfa427109 /core/shared/src/main/scala/interface.scala
parent93e3ff410b93c4d2d886371937ad55c7d269ba99 (diff)
parent5312aa433cb0d5767c61f94c16d84b4c0f60f17b (diff)
downloadmagnolia-c2acc0fd2f4772ea1b6d3a59271fbe2d9063f69f.tar.gz
magnolia-c2acc0fd2f4772ea1b6d3a59271fbe2d9063f69f.tar.bz2
magnolia-c2acc0fd2f4772ea1b6d3a59271fbe2d9063f69f.zip
Merge pull request #67 from sirthias/md/typename
Change `typeName: String` to `typeName: magnolia.TypeName` [BREAKING!]
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