@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ( isManaged() ? 1231 : 1237 ); return result; }
@Override public String toString() { return String.format( "PluginRelationship [%s => %s (managed=%s, index=%s)]", getDeclaring(), getTarget(), isManaged(), getIndex() ); }
@Override public boolean equals( final Object obj ) { if ( this == obj ) { return true; } if ( !super.equals( obj ) ) { return false; } if ( !(obj instanceof PluginRelationship) ) { return false; } final PluginRelationship other = (PluginRelationship) obj; return isManaged() == other.isManaged(); }
@Override public PluginRelationship addSources( final Collection<URI> sources ) { Set<URI> srcs = getSources(); srcs.addAll( sources ); return new SimplePluginRelationship( srcs, getPomLocation(), getDeclaring(), getTarget(), getIndex(), isManaged(), reporting, isInherited() ); } }
@Override public PluginRelationship addSource( final URI source ) { Set<URI> srcs = getSources(); srcs.add( source ); return new SimplePluginRelationship( srcs, getPomLocation(), getDeclaring(), getTarget(), getIndex(), isManaged(), reporting, isInherited() ); }
@Override public synchronized PluginRelationship cloneFor( final ProjectVersionRef projectRef ) { return new SimplePluginRelationship( getSources(), getPomLocation(), projectRef, getTarget(), getIndex(), isManaged(), reporting, isInherited() ); }
@Override public PluginRelationship selectDeclaring( final ProjectVersionRef ref ) { final ProjectVersionRef t = getTarget(); return new SimplePluginRelationship( getSources(), getPomLocation(), ref, t, getIndex(), isManaged(), isReporting(), isInherited() ); }
@Override public PluginRelationship selectTarget( final ProjectVersionRef ref ) { final ProjectVersionRef d = getDeclaring(); return new SimplePluginRelationship( getSources(), getPomLocation(), d, ref, getIndex(), isManaged(), isReporting(), isInherited() ); }