Skip to content

Commit 405560d

Browse files
author
Roman Janusz
committed
added LowerCaseAutoNamedEnum
1 parent 764cac0 commit 405560d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

commons-core/src/main/scala/com/avsystem/commons/misc/SealedUtils.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ trait AutoNamedEnum extends NamedEnum with Product {
9494
def name: String = productPrefix
9595
}
9696

97+
/**
98+
* Like [[AutoNamedEnum]] but derived names are uncapitalized (first letter lowercased).
99+
*/
100+
trait LowerCaseAutoNamedEnum extends AutoNamedEnum {
101+
override def name: String = super.name.uncapitalize
102+
}
103+
97104
/**
98105
* Base trait for companion objects of sealed traits that serve as named enums. `NamedEnumCompanion` is an
99106
* extension of [[SealedEnumCompanion]] which additionally requires that every enum value has distinct string

0 commit comments

Comments
 (0)