All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.ksu.canvas.util.KeyFirstComparator Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package edu.ksu.canvas.util;

import java.util.Comparator;

/**
 * Needed to put the key as the first parameter in the map which is needed for AWS S3 uploads
 */
public class KeyFirstComparator implements Comparator {

    public static final String KEY = "key";

    @Override
    public int compare(String o1, String o2) {
        if (KEY.equals(o1)) {
            return -1;
        }
        if (KEY.equals(o2)) {
            return 1;
        }
        return o1.compareTo(o2);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy