Skip to content

Add EnumValueSimple Trait to reduce EnumValue complexity - #1707

Merged
olabusayoT merged 1 commit into
apache:mainfrom
olabusayoT:daf-2983-enumvaluesimple
Sep 8, 2026
Merged

Add EnumValueSimple Trait to reduce EnumValue complexity#1707
olabusayoT merged 1 commit into
apache:mainfrom
olabusayoT:daf-2983-enumvaluesimple

Conversation

@olabusayoT

@olabusayoT olabusayoT commented Jul 16, 2026

Copy link
Copy Markdown
Contributor
  • add handling exceptions/special cases like CalendarFirstDayOfWeek in property generation instead

DAFFODIL-2983

@olabusayoT olabusayoT changed the title Add EnumValueSimple Trait tp reduce EnumValue complexity Add EnumValueSimple Trait to reduce EnumValue complexity Jul 21, 2026

@stevedlawrence stevedlawrence left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@@ -120,18 +120,15 @@ trait EnumValue extends EnumValueBase {
override lazy val toString = {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, there's a typo in bug number in the commit, it should be DAFFODIL-2983 instead of 2963

}

trait EnumValueSimple extends EnumValueBase {
override def toString = getNameFromClass(this)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we make this a override lazy val to match EnumValue.

}
}

trait EnumValueSimple extends EnumValueBase {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love the name Simple since it doesn't really convey much. Thoughts on EnumValueUpperCamel with the understanding that EnumValue is the normal camel case for the vast majority of properties? No strong preference though if that feels too verbose/specific.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throught on Literal instead? EnumValueLiteral since it's the untransformed version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@olabusayoT
olabusayoT force-pushed the daf-2983-enumvaluesimple branch from dcb1087 to 718f531 Compare August 25, 2026 17:18

@jadams-tresys jadams-tresys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

- add handling exceptions/special cases like CalendarFirstDayOfWeek in property generation instead

DAFFODIL-2983
@olabusayoT
olabusayoT force-pushed the daf-2983-enumvaluesimple branch from 718f531 to d83d56e Compare September 8, 2026 18:26
@olabusayoT
olabusayoT merged commit 60b442b into apache:main Sep 8, 2026
11 checks passed
@olabusayoT
olabusayoT deleted the daf-2983-enumvaluesimple branch September 8, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants