@Override
    public int hashCode() {
      HashCodeBuilder builder = new HashCodeBuilder();

      boolean queryId_present = queryId == null;
      builder.append(queryId_present);
      if (queryId_present) {
        builder.append(queryId);
      }

      boolean lockTime_present = lockTime == null;
      builder.append(lockTime);
      if (lockTime_present) {
        builder.append(lockTime);
      }

      boolean lockMode_present = lockMode == null;
      builder.append(lockMode);
      if (lockMode_present) {
        builder.append(lockMode);
      }

      boolean queryStr_present = queryStr == null;
      builder.append(queryStr);
      if (queryStr_present) {
        builder.append(queryStr);
      }

      boolean clienIp_present = clientIp == null;
      builder.append(clientIp);
      if (clienIp_present) {
        builder.append(clientIp);
      }

      return builder.toHashCode();
    }
Constructor

@param data String of the form "queryId:lockTime:lockMode:queryStr[:clientIp]". 
No ':' characters are allowed in any of the first four components, but the clientIp can contain colons (IPv6).
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/HiveLockObject.java