Change IdAndData#setData parameter to int (#3788)

This commit is contained in:
EnZaXD 2024-04-16 21:00:04 +02:00 committed by GitHub
parent 8fe0681778
commit 57d7fd59cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,11 +31,11 @@ public class IdAndData {
private int id;
private byte data;
public IdAndData(int id) {
public IdAndData(final int id) {
this(id, -1);
}
public IdAndData(int id, int data) {
public IdAndData(final int id, final int data) {
Preconditions.checkArgument(data >= 0 && data <= 15, "Data has to be between 0 and 15: (id: " + id + " data: " + data + ")");
this.id = id;
this.data = (byte) data;
@ -69,7 +69,7 @@ public class IdAndData {
return toRawData(id, data);
}
public IdAndData withData(int data) {
public IdAndData withData(final int data) {
return new IdAndData(this.id, data);
}
@ -85,11 +85,10 @@ public class IdAndData {
return data;
}
public void setData(final byte data) {
this.data = data;
public void setData(final int data) {
this.data = (byte) data;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;