/** * Switch the last remembered type to match the type of the given object. * * @param obj the object * @return the auto-detected type used */ StorageDataTypeBase switchType(Object obj) { int typeId = getTypeId(obj); StorageDataTypeBase l = last; if (typeId != l.getType()) { last = l = newType(typeId); } return l; }