docs: public static PrimitiveObject hadoop2Primitive(Writable object) {
          if (object instanceof NullWritable) {
              return new PrimitiveObject(NULL, null);
          }
  
          if (object instanceof ByteWritable) {
              return new PrimitiveObject(BYTE, ((ByteWritable) object).get());
          } else if (object instanceof IntWritable) {
              return new PrimitiveObject(INTEGER, ((IntWritable) object).get());
          } else if (object instanceof LongWritable) {
              return new PrimitiveObject(LONG, ((LongWritable) object).get());
          } else if (object instanceof DoubleWritable) {
              return new PrimitiveObject(DOUBLE, ((DoubleWritable) object).get());
          } else if (object instanceof FloatWritable) {
              return new PrimitiveObject(FLOAT, ((FloatWritable) object).get());
          } else if (object instanceof BooleanWritable) {
              return new PrimitiveObject(BOOLEAN, ((BooleanWritable) object).get());
          } else if (object instanceof Text) {
              return new PrimitiveObject(STRING, ((Text) object).toString());
          } else if (object instanceof ArrayWritable) {
              ArrayWritable aw = (ArrayWritable) object;
              if (aw.get().length == 0) {
                  return new PrimitiveObject(ARRAY, true, STRING, new ArrayList<String>());
              }
  
              int type = NULL;
              List<Object> l = new ArrayList<Object>();
              for (Writable w : aw.get()){
                  PrimitiveObject no = hadoop2Primitive(w);
                  type = no.getType();
                  l.add(no.getObject());
              }
  
              return new PrimitiveObject(ARRAY, true, type, l);
          } else if (object instanceof MapWritable) {
              MapWritable mw = (MapWritable) object;
              if (mw.size() == 0) {
                  return new PrimitiveObject(MAP, true, STRING, STRING, new HashMap<String, String>());
              }
  
              int keyType = NULL;
              int valueType = NULL;
              Map<Object, Object> m = new HashMap<Object, Object>();
              for (Entry<Writable, Writable> entry : mw.entrySet()){
                  PrimitiveObject keyNo = hadoop2Primitive(entry.getKey());
                  PrimitiveObject valueNo = hadoop2Primitive(entry.getValue());
                  keyType = keyNo.getType();
                  valueType = valueNo.getType();
                  m.put(keyNo.getObject(), valueNo.getObject());
              }
  
              return new PrimitiveObject(MAP, true, keyType, valueType, m);
          }
  
          throw new ClassCastException("cast object not found");
      }