001package org.eclipse.aether.internal.impl.synccontext.named;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022/**
023 * As end-user "mappers" are actually configurations/compositions and are constructed from several NameMapper
024 * implementations, this helper class constructing them. This class also holds "names" used by service locator and
025 * Guice/Sisu as well.
026 *
027 * @since 1.9.4
028 */
029public final class NameMappers
030{
031    public static final String STATIC_NAME = "static";
032
033    public static final String GAV_NAME = "gav";
034
035    public static final String FILE_GAV_NAME = "file-gav";
036
037    public static final String FILE_HGAV_NAME = "file-hgav";
038
039    public static final String DISCRIMINATING_NAME = "discriminating";
040
041    public static NameMapper staticNameMapper()
042    {
043        return new StaticNameMapper();
044    }
045
046    public static NameMapper gavNameMapper()
047    {
048        return GAVNameMapper.gav();
049    }
050
051    public static NameMapper fileGavNameMapper()
052    {
053        return new BasedirNameMapper( GAVNameMapper.fileGav() );
054    }
055
056    public static NameMapper fileHashingGavNameMapper()
057    {
058        return new BasedirNameMapper( new HashingNameMapper( GAVNameMapper.gav() ) );
059    }
060
061    public static NameMapper discriminatingNameMapper()
062    {
063        return new DiscriminatingNameMapper( GAVNameMapper.gav() );
064    }
065}