1package org.apache.archiva.admin.repository.utils;
2/*3 * Licensed to the Apache Software Foundation (ASF) under one4 * or more contributor license agreements. See the NOTICE file5 * distributed with this work for additional information6 * regarding copyright ownership. The ASF licenses this file7 * to you under the Apache License, Version 2.0 (the8 * "License"); you may not use this file except in compliance9 * with the License. You may obtain a copy of the License at10 *11 * http://www.apache.org/licenses/LICENSE-2.012 *13 * Unless required by applicable law or agreed to in writing,14 * software distributed under the License is distributed on an15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY16 * KIND, either express or implied. See the License for the17 * specific language governing permissions and limitations18 * under the License.19 */2021import org.apache.archiva.admin.model.beans.AbstractRepository;
2223import java.util.Comparator;
2425/**26 * @author Olivier Lamy27 * @since 1.4-M128 */29publicclassRepositoryComparator30implements Comparator<AbstractRepository>
31 {
32 @Override
33publicint compare( AbstractRepository../../../../org/apache/archiva/admin/model/beans/AbstractRepository.html#AbstractRepository">AbstractRepository o1, AbstractRepository o2 )
34 {
35if ( o1 == null && o2 == null )
36 {
37return 0;
38 }
3940if ( o1 == null )
41 {
42return -1;
43 }
4445if ( o2 == null )
46 {
47return 1;
48 }
4950return o1.getId().compareToIgnoreCase( o2.getId() );
51 }
52 }