1 /*******************************************************************************
2 * Copyright (c) 2012 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
.resolution
;
13 import org
.eclipse
.aether
.repository
.RemoteRepository
;
16 * A query for the resolution error policy for a given artifact/metadata.
18 * @param <T> The type of the affected repository item (artifact or metadata).
19 * @see ResolutionErrorPolicy
21 public final class ResolutionErrorPolicyRequest
<T
>
26 private RemoteRepository repository
;
29 * Creates an uninitialized request.
31 public ResolutionErrorPolicyRequest()
33 // enables default constructor
37 * Creates a request for the specified artifact/metadata and remote repository.
39 * @param item The artifact/metadata for which to determine the error policy, may be {@code null}.
40 * @param repository The repository from which the resolution is attempted, may be {@code null}.
42 public ResolutionErrorPolicyRequest( T item
, RemoteRepository repository
)
45 setRepository( repository
);
49 * Gets the artifact/metadata for which to determine the error policy.
51 * @return The artifact/metadata for which to determine the error policy or {@code null} if not set.
59 * Sets the artifact/metadata for which to determine the error policy.
61 * @param item The artifact/metadata for which to determine the error policy, may be {@code null}.
62 * @return This request for chaining, never {@code null}.
64 public ResolutionErrorPolicyRequest
<T
> setItem( T item
)
71 * Gets the remote repository from which the resolution of the artifact/metadata is attempted.
73 * @return The involved remote repository or {@code null} if not set.
75 public RemoteRepository
getRepository()
81 * Sets the remote repository from which the resolution of the artifact/metadata is attempted.
83 * @param repository The repository from which the resolution is attempted, may be {@code null}.
84 * @return This request for chaining, never {@code null}.
86 public ResolutionErrorPolicyRequest
<T
> setRepository( RemoteRepository repository
)
88 this.repository
= repository
;
93 public String
toString()
95 return getItem() + " < " + getRepository();