53 lines
1.1 KiB
Java
53 lines
1.1 KiB
Java
package it.cavallium.strangedb.database.references;
|
|
|
|
import java.util.Objects;
|
|
import java.util.StringJoiner;
|
|
|
|
public class ReferenceInfo {
|
|
private final long index;
|
|
private final int size;
|
|
private final byte cleanerId;
|
|
|
|
public ReferenceInfo(long index, int size, byte cleanerId) {
|
|
this.index = index;
|
|
this.size = size;
|
|
this.cleanerId = cleanerId;
|
|
}
|
|
|
|
public long getIndex() {
|
|
return index;
|
|
}
|
|
|
|
public int getSize() {
|
|
return size;
|
|
}
|
|
|
|
public byte getCleanerId() {
|
|
return cleanerId;
|
|
}
|
|
|
|
@Override
|
|
public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
ReferenceInfo that = (ReferenceInfo) o;
|
|
return index == that.index &&
|
|
size == that.size &&
|
|
cleanerId == that.cleanerId;
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(index);
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return new StringJoiner(", ", ReferenceInfo.class.getSimpleName() + "[", "]")
|
|
.add("index=" + index)
|
|
.add("size=" + size)
|
|
.add("cleanerId=" + cleanerId)
|
|
.toString();
|
|
}
|
|
}
|