@Override public String toString() { return String.format( "DependencyRelationship [%s => %s (managed=%s, scope=%s, index=%s)]", getDeclaring(), getTarget(), isManaged(), scope, getIndex() ); }
@Override public DependencyRelationship selectDeclaring( final ProjectVersionRef ref ) { final ArtifactRef t = getTarget(); Set<ProjectRef> var = getExcludes(); return new SimpleDependencyRelationship( getSources(), getPomLocation(), ref, t, getScope(), getIndex(), isManaged(), isInherited(), optional, var.toArray( new ProjectRef[var.size()] ) ); }
@Override public DependencyRelationship addSource( final URI source ) { Set<URI> srcs = getSources(); srcs.add( source ); return new SimpleDependencyRelationship( srcs, getPomLocation(), getDeclaring(), getTarget(), scope, getIndex(), isManaged(), isInherited(), optional ); }
@Override public DependencyRelationship addSources( final Collection<URI> sources ) { Set<URI> srcs = getSources(); srcs.addAll( sources ); return new SimpleDependencyRelationship( srcs, getPomLocation(), getDeclaring(), getTarget(), scope, getIndex(), isManaged(), isInherited(), optional ); }
@Override public synchronized DependencyRelationship cloneFor( final ProjectVersionRef projectRef ) { return new SimpleDependencyRelationship( getSources(), getPomLocation(), projectRef, getTarget(), scope, getIndex(), isManaged(), isInherited(), optional ); }
@Override public DependencyRelationship selectTarget( final ProjectVersionRef ref ) { final ProjectVersionRef d = getDeclaring(); ArtifactRef t = getTarget(); t = (ArtifactRef) ( ( ref instanceof ArtifactRef ) ? ref : new SimpleArtifactRef( ref, t.getType(), t.getClassifier() ) ); Set<ProjectRef> var = getExcludes(); return new SimpleDependencyRelationship( getSources(), getPomLocation(), d, t, getScope(), getIndex(), isManaged(), isInherited(), optional, var.toArray( new ProjectRef[var.size()] ) ); }