Example #1
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((dataType == null) ? 0 : dataType.hashCode());
   result = prime * result + tagNumber;
   result = prime * result + valueCount;
   result = prime * result + valueLength;
   result =
       prime * result + ((valueOrOffsetSequence == null) ? 0 : valueOrOffsetSequence.hashCode());
   return result;
 }
Example #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (obj == null) {
      return false;
    }

    if (getClass() != obj.getClass()) {
      return false;
    }

    FieldAttributes other = (FieldAttributes) obj;

    if (dataType != other.dataType) {
      return false;
    }

    if (tagNumber != other.tagNumber) {
      return false;
    }

    if (valueCount != other.valueCount) {
      return false;
    }

    if (valueLength != other.valueLength) {
      return false;
    }

    if (valueOrOffsetSequence == null) {
      if (other.valueOrOffsetSequence != null) {
        return false;
      }
    } else if (!valueOrOffsetSequence.equals(other.valueOrOffsetSequence)) {
      return false;
    }

    return true;
  }