public static String getUniqueKey ( final ErrorItem errorItem ) { if ( errorItem == null ) { throw new NullPointerException ( "ErrorItem is null" ) ; } String type = errorItem . getErrorType ( ) ; String typeCode = errorItem . getErrorTypeCode ( ) ; String method = errorItem . getSourceMethod ( ) ; String uniqueKey = String . format ( "%s-%s-%s" , type , typeCode , method ) ; return MessageDigests . md5Hex ( uniqueKey ) ; }
Generates a unique key based on the error . The key will be an MD5 hash of the type type code and method .