- public String toString() {
- String valueString = (value == null) ? "null"
- : (value instanceof byte[]) ? HexEncode
- .bytesToHexString((byte[]) value) : value.toString();
- String maskString = (mask == null) ? "null"
- : (mask instanceof byte[]) ? HexEncode
- .bytesToHexString((byte[]) mask) : mask.toString();
-
- return type + "(" + valueString + "," + maskString + ")";
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ MatchField other = (MatchField) obj;
+ if (type != other.type) {
+ return false;
+ }
+ return (type.equalValues(this.value, other.value) && type.equalMasks(
+ this.mask, other.mask));