@Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Dependency that = (Dependency) obj; return artifact.equals( that.artifact ) && scope.equals( that.scope ) && eq( optional, that.optional ) && exclusions.equals( that.exclusions ); }
@Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( obj == null || !getClass().equals( obj.getClass() ) ) { return false; } Dependency that = (Dependency) obj; return artifact.equals( that.artifact ) && scope.equals( that.scope ) && eq( optional, that.optional ) && exclusions.equals( that.exclusions ); }
/** * Sets the optional flag for the dependency. * * @param optional {@code true} if the dependency is optional, {@code false} if the dependency is mandatory, may be * {@code null} if unspecified. * @return The new dependency, never {@code null}. */ public Dependency setOptional( Boolean optional ) { if ( eq( this.optional, optional ) ) { return this; } return new Dependency( artifact, scope, exclusions, optional ); }
/** * Sets the optional flag for the dependency. * * @param optional {@code true} if the dependency is optional, {@code false} if the dependency is mandatory, may be * {@code null} if unspecified. * @return The new dependency, never {@code null}. */ public Dependency setOptional( Boolean optional ) { if ( eq( this.optional, optional ) ) { return this; } return new Dependency( artifact, scope, exclusions, optional ); }