X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.repo%2Fsrc%2Forg%2Feclipse%2Faether%2Fcollection%2FDependencyManagement.java;fp=org.argeo.slc.repo%2Fsrc%2Forg%2Feclipse%2Faether%2Fcollection%2FDependencyManagement.java;h=f0aac73455771970672a7b0cfc142a5c5e21d707;hb=825d60c5348dbe3f5be25b0bccf7bdebfe694219;hp=0000000000000000000000000000000000000000;hpb=5e991fff5cba01858dcc5747a27e637325bc5c8e;p=gpl%2Fargeo-jcr.git diff --git a/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyManagement.java b/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyManagement.java new file mode 100644 index 0000000..f0aac73 --- /dev/null +++ b/org.argeo.slc.repo/src/org/eclipse/aether/collection/DependencyManagement.java @@ -0,0 +1,168 @@ +/******************************************************************************* + * Copyright (c) 2010, 2013 Sonatype, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sonatype, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.aether.collection; + +import java.util.Collection; +import java.util.Map; + +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.graph.Exclusion; + +/** + * The management updates to apply to a dependency. + * + * @see DependencyManager#manageDependency(Dependency) + */ +public final class DependencyManagement +{ + + private String version; + + private String scope; + + private Boolean optional; + + private Collection exclusions; + + private Map properties; + + /** + * Creates an empty management update. + */ + public DependencyManagement() + { + // enables default constructor + } + + /** + * Gets the new version to apply to the dependency. + * + * @return The new version or {@code null} if the version is not managed and the existing dependency version should + * remain unchanged. + */ + public String getVersion() + { + return version; + } + + /** + * Sets the new version to apply to the dependency. + * + * @param version The new version, may be {@code null} if the version is not managed. + * @return This management update for chaining, never {@code null}. + */ + public DependencyManagement setVersion( String version ) + { + this.version = version; + return this; + } + + /** + * Gets the new scope to apply to the dependency. + * + * @return The new scope or {@code null} if the scope is not managed and the existing dependency scope should remain + * unchanged. + */ + public String getScope() + { + return scope; + } + + /** + * Sets the new scope to apply to the dependency. + * + * @param scope The new scope, may be {@code null} if the scope is not managed. + * @return This management update for chaining, never {@code null}. + */ + public DependencyManagement setScope( String scope ) + { + this.scope = scope; + return this; + } + + /** + * Gets the new optional flag to apply to the dependency. + * + * @return The new optional flag or {@code null} if the flag is not managed and the existing optional flag of the + * dependency should remain unchanged. + */ + public Boolean getOptional() + { + return optional; + } + + /** + * Sets the new optional flag to apply to the dependency. + * + * @param optional The optional flag, may be {@code null} if the flag is not managed. + * @return This management update for chaining, never {@code null}. + */ + public DependencyManagement setOptional( Boolean optional ) + { + this.optional = optional; + return this; + } + + /** + * Gets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of + * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged + * with information from dependency management or overridden by it. + * + * @return The new exclusions or {@code null} if the exclusions are not managed and the existing dependency + * exclusions should remain unchanged. + */ + public Collection getExclusions() + { + return exclusions; + } + + /** + * Sets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of + * exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged + * with information from dependency management or overridden by it. + * + * @param exclusions The new exclusions, may be {@code null} if the exclusions are not managed. + * @return This management update for chaining, never {@code null}. + */ + public DependencyManagement setExclusions( Collection exclusions ) + { + this.exclusions = exclusions; + return this; + } + + /** + * Gets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, + * i.e. the dependency manager controls whether any existing properties get merged with the information from + * dependency management or overridden by it. + * + * @return The new artifact properties or {@code null} if the properties are not managed and the existing properties + * should remain unchanged. + */ + public Map getProperties() + { + return properties; + } + + /** + * Sets the new properties to apply to the dependency. Note that this map denotes the complete set of properties, + * i.e. the dependency manager controls whether any existing properties get merged with the information from + * dependency management or overridden by it. + * + * @param properties The new artifact properties, may be {@code null} if the properties are not managed. + * @return This management update for chaining, never {@code null}. + */ + public DependencyManagement setProperties( Map properties ) + { + this.properties = properties; + return this; + } + +}