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

dk.eobjects.metamodel.SchemaNameComparator Maven / Gradle / Ivy

/**
 *  This file is part of MetaModel.
 *
 *  MetaModel is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  MetaModel is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with MetaModel.  If not, see .
 */
package dk.eobjects.metamodel;

import java.util.Comparator;

class SchemaNameComparator implements Comparator {

	private static Comparator _instance = new SchemaNameComparator();

	public static Comparator getInstance() {
		return _instance;
	}

	private SchemaNameComparator() {
	}

	public int compare(String o1, String o2) {
		if (o1 == null && o2 == null) {
			return 0;
		}
		if (o1 == null) {
			return -1;
		}
		if (o2 == null) {
			return 1;
		}
		return o1.compareTo(o2);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy