public JSONAPIDocument<User> fetchUser(Collection<User.UserField> optionalFields) throws IOException {
    URIBuilder pathBuilder = new URIBuilder()
                    .setPath("current_user")
                    .addParameter("include", "pledges");
    if (optionalFields != null) {
      Set<User.UserField> optionalAndDefaultFields = new HashSet<>(optionalFields);
      optionalAndDefaultFields.addAll(User.UserField.getDefaultFields());
      addFieldsParam(pathBuilder, User.class, optionalAndDefaultFields);
    }

    return converter.readDocument(
      getDataStream(pathBuilder.toString()),
      User.class
    );
  }
public JSONAPIDocument < User > fetchUser ( Collection < User . UserField > optionalFields ) throws IOException { URIBuilder pathBuilder = new URIBuilder ( ) . setPath ( "current_user" ) . addParameter ( "include" , "pledges" ) ; if ( optionalFields != null ) { Set < User . UserField > optionalAndDefaultFields = new HashSet < > ( optionalFields ) ; optionalAndDefaultFields . addAll ( User . UserField . getDefaultFields ( ) ) ; addFieldsParam ( pathBuilder , User . class , optionalAndDefaultFields ) ; } return converter . readDocument ( getDataStream ( pathBuilder . toString ( ) ) , User . class ) ; }
Get the user object of the creator

@param optionalFields A list of optional fields to request, or null.  See {@link User.UserField}
@return the current user
@throws IOException Thrown when the GET request failed