Implements Player.Events#equals()

It's convenient for testing.

PiperOrigin-RevId: 373280130
This commit is contained in:
jaewan 2021-05-12 03:17:07 +01:00 committed by Oliver Woodman
parent 1da25f5979
commit b2b6e0ecb5

View File

@ -404,6 +404,23 @@ public interface Player {
public int get(int index) { public int get(int index) {
return flags.get(index); return flags.get(index);
} }
@Override
public int hashCode() {
return flags.hashCode();
}
@Override
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Events)) {
return false;
}
Events other = (Events) obj;
return flags.equals(other.flags);
}
} }
/** Position info describing a playback position involved in a discontinuity. */ /** Position info describing a playback position involved in a discontinuity. */