AlertEntity { public String getKey() { StringBuffer sb = new StringBuffer(alertType + ""); if (dc != null && !dc.isEmpty()) { sb.append(":").append(dc); } if(clusterId != null && !clusterId.isEmpty()) { sb.append(":").append(clusterId); } if(shardId != null && !shardId.isEmpty()) { sb.append(":").append(shardId); } if(hostPort != null) { sb.append(":").append(hostPort.toString()); } if(message != null && !message.isEmpty()) { sb.append(":").append(message); } return sb.toString(); } AlertEntity(HostPort hostPort, String dc, String clusterId, String shardId,
                       String message, ALERT_TYPE alertType); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); String getKey(); String getDc(); void setDc(String dc); ALERT_TYPE getAlertType(); String getMessage(); AlertEntity setMessage(String message); HostPort getHostPort(); AlertEntity setHostPort(HostPort hostPort); String getClusterId(); AlertEntity setClusterId(String clusterId); String getShardId(); AlertEntity setShardId(String shardId); Date getDate(); AlertEntity setDate(Date date); void setAlertType(ALERT_TYPE alertType); void removeSpecialCharacters();  }
@Test public void getKey() throws Exception { String key = ALERT_TYPE.XREDIS_VERSION_NOT_VALID + ":"; System.out.println(key); }