org.opentcs.util.persistence.v004.Comparators Maven / Gradle / Ivy
/**
* Copyright (c) The openTCS Authors.
*
* This program is free software and subject to the MIT license. (For details,
* see the licensing information (LICENSE.txt) you should have received with
* this copy of the software.)
*/
package org.opentcs.util.persistence.v004;
import java.util.Comparator;
/**
* Some comparator implementations for JAXB classes.
*/
public final class Comparators {
/**
* Prevents instantiation.
*/
private Comparators() {
}
/**
* Returns a comparator for ordering PlantModelElementTO
s ascendingly by their names.
*
* @return A comparator for ordering PlantModelElementTO
s ascendingly by their names.
*/
public static Comparator elementsByName() {
return Comparator.comparing(PlantModelElementTO::getName);
}
/**
* Returns a comparator for ordering OutgoingPath
s ascendingly by their names.
*
* @return A comparator for ordering OutgoingPath
s ascendingly by their names.
*/
public static Comparator outgoingPathsByName() {
return Comparator.comparing(PointTO.OutgoingPath::getName);
}
/**
* Returns a comparator for ordering Link
s ascendingly by their point names.
*
* @return A comparator for ordering Link
s ascendingly by their point names.
*/
public static Comparator linksByPointName() {
return Comparator.comparing(LocationTO.Link::getPoint);
}
/**
* Returns a comparator for ordering Properties
s ascendingly by their names.
*
* @return A comparator for ordering Properties
ascendingly by their names.
*/
public static Comparator propertiesByName() {
return Comparator.comparing(PropertyTO::getName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy