filebot/source/net/filebot/similarity/Match.java

45 lines
767 B
Java
Raw Normal View History

2014-04-19 02:30:29 -04:00
package net.filebot.similarity;
2016-10-30 17:03:39 -04:00
import java.util.Objects;
public class Match<Value, Candidate> {
2015-07-25 18:47:19 -04:00
private final Value value;
private final Candidate candidate;
2015-07-25 18:47:19 -04:00
public Match(Value value, Candidate candidate) {
this.value = value;
this.candidate = candidate;
}
2015-07-25 18:47:19 -04:00
public Value getValue() {
return value;
}
2015-07-25 18:47:19 -04:00
public Candidate getCandidate() {
return candidate;
}
2015-07-25 18:47:19 -04:00
@Override
public boolean equals(Object obj) {
if (obj instanceof Match) {
Match<?, ?> other = (Match<?, ?>) obj;
return value == other.value && candidate == other.candidate;
}
2015-07-25 18:47:19 -04:00
return false;
}
2015-07-25 18:47:19 -04:00
@Override
public int hashCode() {
2016-10-30 17:03:39 -04:00
return Objects.hash(value, candidate);
}
2015-07-25 18:47:19 -04:00
@Override
public String toString() {
return String.format("[%s, %s]", value, candidate);
}
2015-07-25 18:47:19 -04:00
}