package me.ivanyu.simplekv.types;

import java.util.Comparator;

public class KeyComparator implements Comparator<Key> {
    public static final KeyComparator INSTANCE = new KeyComparator();

    @Override
    public int compare(Key k1, Key k2) {
        if (k1 == null)
            throw new NullPointerException("k1 can't be null");
        if (k2 == null)
            throw new NullPointerException("k2 can't be null");

        return k1.keyValue.compareTo(k2.keyValue);
    }
}
