package cn.axzo.msg.center.message.service.group;

import cn.axzo.maokai.api.vo.response.tree.ValueNode;

import java.util.Comparator;

/**
 * @author yanglin
 */
class NodeComparator implements Comparator<ValueNode<NodeWrapper>> {

    static final NodeComparator INSTANCE = new NodeComparator();

    private NodeComparator() {
    }

    @Override
    public int compare(ValueNode<NodeWrapper> n1, ValueNode<NodeWrapper> n2) {
        Long id1 = n1.getValue().unwrap().getId();
        Long id2 = n2.getValue().unwrap().getId();
        return Long.compare(id1, id2);
    }
}
