private static final String FIELD_SCM_ACCOUNTS = "scmAccounts";
private static final String FIELD_GROUPS = "groups";
private static final String FIELD_ACTIVE = "active";
- private static final String FIELD_TOKEN_COUNT = "tokenCount";
+ private static final String FIELD_TOKENS_COUNT = "tokensCount";
public static final Set<String> FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_SCM_ACCOUNTS, FIELD_GROUPS, FIELD_ACTIVE);
private static final Set<String> CONCISE_FIELDS = ImmutableSet.of(FIELD_NAME, FIELD_EMAIL, FIELD_ACTIVE);
/**
* Serializes a user to the passed JsonWriter.
*/
- public void write(JsonWriter json, User user, @Nullable Integer tokenCount, Collection<String> groups, @Nullable Collection<String> fields) {
+ public void write(JsonWriter json, User user, @Nullable Integer tokensCount, Collection<String> groups, @Nullable Collection<String> fields) {
json.beginObject();
json.prop(FIELD_LOGIN, user.login());
writeIfNeeded(json, user.name(), FIELD_NAME, fields);
writeIfNeeded(json, user.active(), FIELD_ACTIVE, fields);
writeGroupsIfNeeded(json, groups, fields);
writeScmAccountsIfNeeded(json, fields, user);
- writeTokenCount(json, tokenCount);
+ writeTokensCount(json, tokensCount);
json.endObject();
}
}
}
- private static void writeTokenCount(JsonWriter json, @Nullable Integer tokenCount) {
+ private static void writeTokensCount(JsonWriter json, @Nullable Integer tokenCount) {
if (tokenCount == null) {
return;
}
- json.prop(FIELD_TOKEN_COUNT, tokenCount);
+ json.prop(FIELD_TOKENS_COUNT, tokenCount);
}
}