mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Implement hashCode() when you implement equals()!
This commit is contained in:
@@ -43,4 +43,15 @@ public class MusicStateSpec {
|
|||||||
this.shuffle == stateSpec.shuffle &&
|
this.shuffle == stateSpec.shuffle &&
|
||||||
this.repeat == stateSpec.repeat;
|
this.repeat == stateSpec.repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = (int) state;
|
||||||
|
// ignore the position -- it is taken into account in equals()
|
||||||
|
// result = 31 * result + position;
|
||||||
|
result = 31 * result + playRate;
|
||||||
|
result = 31 * result + (int) shuffle;
|
||||||
|
result = 31 * result + (int) repeat;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user