Debian Codegraph @

fontawesomefx-fontawesome/src/main/java/de/jensd/fx/glyphs/fontawesome/utils/FontAwesomeIconNameComparator.java

raw
1 /**
2 * Copyright (c) 2015 Jens Deters http://www.jensd.de
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9 * KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
10 *
11 */
12 package de.jensd.fx.glyphs.fontawesome.utils;
13
14 import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon;
15 import java.util.Comparator;
16
17 /**
18 *
19 * @author Jens Deters
20 */
21 public class FontAwesomeIconNameComparator implements Comparator<FontAwesomeIcon> {
22
23 @Override
24 public int compare(FontAwesomeIcon o1, FontAwesomeIcon o2) {
25 if(o1 != null && o2 != null){
26 return o1.name().compareTo(o2.name());
27 }
28 return 0;
29 }
30 }