code: public static int typeCompareTo(Writable one, Writable other) {
          PrimitiveObject noOne = hadoop2Primitive(one);
          PrimitiveObject noOther = hadoop2Primitive(other);
          if (noOne.getType() != noOther.getType()) {
              return -1;
          }
  
          return 0;
      }
docs: Compare the type Writable.
  @param one the original object
  @param other the object to be compared.
  @return if 0, are equal.