org.opentcs.util.persistence.v004.Comparators Maven / Gradle / Ivy
The newest version!
// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
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);
}
}