> On Dec 16, 2023, at 1:41 PM, Dale Newfield <d...@newfield.org> wrote: > > Unrelated to your question, but why do you create redundant maps every time > your static getter method is called? (And note they're mutable.) > > You can eliminate all that syntax, remove the getter side-effects, and add > the safety of immutability with Lombok and the Map static constructors: > > @Getter > private static final Map<Character,String> statusMap = Map.ofEntries( > Map.entry(User.ACTIVE, "Active"), > Map.entry(User.INACTIVE, "Inactive")); > > I've found "declarative-looking" code to be MUCH more concise and > comprehensible, and thus more maintainable. > > -Dale > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org >
Thanks for the suggestion - I will check that out. Ralph --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org