I am trying to make a generic array in java - in which i am having some issues - how can i make an array of Tuples which is of size 6 and has size a byte[] and a Integer inside?
Thanks
private Tuple<byte[], Integer>[] alternativeImages1 = new Tuple<byte[], Integer>[6];
class Tuple<F, S> {
public final F first;
public final S second;
public Tuple(final F first, final S second) {
this.first = first;
this.second = second;
}
@Override
public boolean equals(final Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
final Tuple tuple = (Tuple) o;
return this.first == tuple.first && this.second == tuple.second;
}
@Override
public int hashCode() {
int result = this.first != null ? first.hashCode() : 0;
result = 31 * result + (this.second != null ? second.hashCode() : 0);
return result;
}
}