a child generated a message
| 4 | * a child generated a message |
| 5 | */ |
| 6 | public class Message implements Event { |
| 7 | public enum Severity { |
| 8 | VERBOSE, |
| 9 | INFO, |
| 10 | WARNING, |
| 11 | ERROR, |
| 12 | FATAL |
| 13 | } |
| 14 | |
| 15 | public final Severity severity; |
| 16 | public final String message; |
| 17 | |
| 18 | public Message(String severity, String message) throws IllegalArgumentException { |
| 19 | // we use String to avoid caching tens of jmethodID ( one for every enum value ) |
| 20 | this.severity = Severity.valueOf(severity); |
| 21 | this.message = message; |
| 22 | } |
| 23 | |
| 24 | @Override |
| 25 | public String toString() { |
| 26 | return String.format("Message: { Severity='%s', message='%s' }", severity.name(), message); |
| 27 | } |
| 28 | } |
nothing calls this directly
no outgoing calls
no test coverage detected