@Override public int hashCode() { // Not relying on Enum hashcode String typeString = type == null ? null : type.getName(); return Objects.hash(typeString, field); }
/** * Returns the name of the result field to use for the given {@link GroupOperation}. If the operation * does specify a newName, it will be returned. Otherwise, a composite name containing the type of the * operation as well as the field name will be used (if provided). * * @param operation The operation to get the name for. * @return a String representing a name for the result of the operation. */ public static String getResultName(GroupOperation operation) { String name = operation.getNewName(); if (name != null) { return name; } GroupOperation.GroupOperationType type = operation.getType(); String field = operation.getField(); if (field == null) { return type.getName(); } return type.getName() + NAME_SEPARATOR + operation.getField(); }