blob: 74485d13a534eb622c8c571ae07e2652daf92b5a (
plain) (
tree)
|
|
import java.util.*;
public class Preganjanje {
private Class<?> preganjalec;
private Class<?> preganjan;
public Preganjanje (Class<?> preganjalec, Class<?> preganjan) {
this.preganjalec = preganjalec;
this.preganjan = preganjan;
}
public int hashCode () {
return 1;
//return Objects.hash(preganjalec, preganjan);
}
@Override
public boolean equals (Object drugi) {
if (this == drugi)
return true;
if (drugi == null || getClass() != drugi.getClass())
return false;
Preganjanje drugo = (Preganjanje) drugi;
return preganjalec.equals(drugo.preganjalec) && preganjan.equals(drugo.preganjan);
}
public String toString () {
return String.format("%s->%s", preganjalec.getName(), preganjan.getName());
}
}
|