It's probably better to use Value.getAsString() here. The call to Object.toString() looks suspicous.