Laur's blog
Sign in Subscribe

enum

A collection of 1 post
Use a Java Enum with Strings
enum

Use a Java Enum with Strings

In my project I wanted to log messages using predefined categories. Traditionally, I do it via classes (if the messages are specific to the functions provided by that class): public class LogWrapper { public static final String EVENT_ERROR = "Error"; public static final String EVENT_LOAD = "Load"
Mar 10, 2015 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost