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