diff options
author | Mathias <mathias@decodified.com> | 2018-01-04 17:45:02 +0100 |
---|---|---|
committer | Mathias <mathias@decodified.com> | 2018-01-04 17:45:02 +0100 |
commit | 5312aa433cb0d5767c61f94c16d84b4c0f60f17b (patch) | |
tree | 59539174a7683432ee437e2463ff5d7bfa427109 /core/shared/src/main/scala/interface.scala | |
parent | 93e3ff410b93c4d2d886371937ad55c7d269ba99 (diff) | |
download | magnolia-5312aa433cb0d5767c61f94c16d84b4c0f60f17b.tar.gz magnolia-5312aa433cb0d5767c61f94c16d84b4c0f60f17b.tar.bz2 magnolia-5312aa433cb0d5767c61f94c16d84b4c0f60f17b.zip |
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.scala | 11 |
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 |