package org.zanata.async;

import java.io.Serializable;

import com.google.common.base.Joiner;

/**
 * @author Patrick Huang <a href="mailto:pahuang@redhat.com">pahuang@redhat.com</a>
 */
public interface AsyncTaskKey extends Serializable {
    /**
     * When converting multiple fields to form id string, we
     * should use this as separator (URL friendly).
     */
    String SEPARATOR = "-";

    String id();

    /**
     * Helper method to convert list of fields to a String as key id.
     *
     * @param keyName
     *         the name for this key
     * @param fields
     *         key instance field values
     * @return String representation of the key which can be used as id
     */
    static String joinFields(String keyName, String... fields) {
        return keyName + SEPARATOR
                + Joiner.on(SEPARATOR).useForNull("").join(fields);
    }
}

@@ -392,16 +392,79 @@
 = %22-%22;%0A%0A
+    /**%0A     * @return a unique identifier for the key%0A     */%0A
     Stri

add comment to class