code: public Field field(String name) {
      for (Field field : declaredFields) {
        if (field.name().equals(name)) {
          return field;
        }
      }
      for (OneOf oneOf : oneOfs) {
        for (Field field : oneOf.fields()) {
          if (field.name().equals(name)) {
            return field;
          }
        }
      }
      return null;
    }
docs: Returns the field named {@code name}, or null if this type has no such field.