@Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("AlertMessage:"); sb.append("\n Level: "); if (level != null) { if (AlertLevel.getAlertLevel(level.getValue()) == AlertLevel.UNDEFINED) { sb.append(level.getValue()); } else { sb.append(AlertLevel.getAlertLevel(level.getValue())); } } else { sb.append("null"); } sb.append("\n Description: "); if (description != null) { if (AlertDescription.getAlertDescription(description.getValue()) == null) { sb.append(description.getValue()); } else { sb.append(AlertDescription.getAlertDescription(description.getValue())); } } else { sb.append("null"); } return sb.toString(); }
@Override public String toCompactString() { StringBuilder sb = new StringBuilder(); String levelString; String descriptionString; if (level != null && level.getValue() != null) { levelString = AlertLevel.getAlertLevel(level.getValue()).name(); } else { levelString = "null"; } if (description != null && description.getValue() != null) { AlertDescription desc = AlertDescription.getAlertDescription(description.getValue()); if (desc != null) { descriptionString = desc.name(); } else { descriptionString = "" + description.getValue(); } } else { descriptionString = "null"; } sb.append("Alert(").append(levelString).append(",").append(descriptionString).append(")"); return sb.toString(); }
if (lm.getProtocolMessageType() == ProtocolMessageType.ALERT) { AlertMessage am = ((AlertMessage) lm); LOGGER.info(" Last protocol message: Alert ({},{}) [{},{}]", AlertLevel.getAlertLevel(am.getLevel() .getValue()), AlertDescription.getAlertDescription(am.getDescription().getValue()), am.getLevel() .getValue(), am.getDescription().getValue());