
com.github.marschal.svndiffstat.DiffStat Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of svn-diffstat Show documentation
Show all versions of svn-diffstat Show documentation
Creates git like diff stat over a whole svn repository.
The newest version!
package com.github.marschal.svndiffstat;
final class DiffStat {
private int added;
private int removed;
DiffStat(int added, int removed) {
this.added = added;
this.removed = removed;
}
@Override
public String toString() {
return this.added + " insertions(+), " + this.removed + " deletions(-)";
}
void add(DiffStat other) {
this.added += other.added;
this.removed += other.removed;
}
int added() {
return this.added;
}
int removed() {
return this.removed;
}
int delta() {
return this.added - this.removed;
}
@Override
public int hashCode() {
return this.added ^ this.removed;
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof DiffStat)) {
return false;
}
DiffStat other = (DiffStat) obj;
return this.added == other.added
&& this.removed == other.removed;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy