Skip to content
Snippets Groups Projects
Commit 49e9660e authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

handle "TODO: remove equals/hashCode/toString once aosp/1536721 merged"


aosp/1536721 is merged, so this code duplication should not be needed any more.

Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: Ic05adfc46495086d7f681322aac7acddc30a2260
parent f6a4f3ea
No related branches found
No related tags found
No related merge requests found
......@@ -28,26 +28,4 @@ public class TetherLimitKey extends Struct {
public TetherLimitKey(final int ifindex) {
this.ifindex = ifindex;
}
// TODO: remove equals, hashCode and toString once aosp/1536721 is merged.
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof TetherLimitKey)) return false;
final TetherLimitKey that = (TetherLimitKey) obj;
return ifindex == that.ifindex;
}
@Override
public int hashCode() {
return Integer.hashCode(ifindex);
}
@Override
public String toString() {
return String.format("ifindex: %d", ifindex);
}
}
......@@ -32,26 +32,4 @@ public class TetherLimitValue extends Struct {
public TetherLimitValue(final long limit) {
this.limit = limit;
}
// TODO: remove equals, hashCode and toString once aosp/1536721 is merged.
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof TetherLimitValue)) return false;
final TetherLimitValue that = (TetherLimitValue) obj;
return limit == that.limit;
}
@Override
public int hashCode() {
return Long.hashCode(limit);
}
@Override
public String toString() {
return String.format("limit: %d", limit);
}
}
......@@ -28,26 +28,4 @@ public class TetherStatsKey extends Struct {
public TetherStatsKey(final long ifindex) {
this.ifindex = ifindex;
}
// TODO: remove equals, hashCode and toString once aosp/1536721 is merged.
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof TetherStatsKey)) return false;
final TetherStatsKey that = (TetherStatsKey) obj;
return ifindex == that.ifindex;
}
@Override
public int hashCode() {
return Long.hashCode(ifindex);
}
@Override
public String toString() {
return String.format("ifindex: %d", ifindex);
}
}
......@@ -47,34 +47,4 @@ public class TetherStatsValue extends Struct {
this.txBytes = txBytes;
this.txErrors = txErrors;
}
// TODO: remove equals, hashCode and toString once aosp/1536721 is merged.
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof TetherStatsValue)) return false;
final TetherStatsValue that = (TetherStatsValue) obj;
return rxPackets == that.rxPackets
&& rxBytes == that.rxBytes
&& rxErrors == that.rxErrors
&& txPackets == that.txPackets
&& txBytes == that.txBytes
&& txErrors == that.txErrors;
}
@Override
public int hashCode() {
return Long.hashCode(rxPackets) ^ Long.hashCode(rxBytes) ^ Long.hashCode(rxErrors)
^ Long.hashCode(txPackets) ^ Long.hashCode(txBytes) ^ Long.hashCode(txErrors);
}
@Override
public String toString() {
return String.format("rxPackets: %s, rxBytes: %s, rxErrors: %s, txPackets: %s, "
+ "txBytes: %s, txErrors: %s", rxPackets, rxBytes, rxErrors, txPackets,
txBytes, txErrors);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment