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.collection;
020
021import org.eclipse.aether.RepositorySystemSession;
022
023/**
024 * A context used during dependency collection to exchange information within a chain of dependency graph transformers.
025 *
026 * @see DependencyGraphTransformer
027 * @noimplement This interface is not intended to be implemented by clients.
028 * @noextend This interface is not intended to be extended by clients.
029 */
030public interface DependencyGraphTransformationContext {
031
032    /**
033     * Gets the repository system session during which the graph transformation happens.
034     *
035     * @return The repository system session, never {@code null}.
036     */
037    RepositorySystemSession getSession();
038
039    /**
040     * Gets a keyed value from the context.
041     *
042     * @param key The key used to query the value, must not be {@code null}.
043     * @return The queried value or {@code null} if none.
044     */
045    Object get(Object key);
046
047    /**
048     * Puts a keyed value into the context.
049     *
050     * @param key The key used to store the value, must not be {@code null}.
051     * @param value The value to store, may be {@code null} to remove the mapping.
052     * @return The previous value associated with the key or {@code null} if none.
053     */
054    Object put(Object key, Object value);
055}