Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Conversation

@homedirectory
Copy link

Currently FieldSpec and TypeSpec both have addModifiers method that accepts a variable number of arguments of type Modifier:

public Builder addModifiers(Modifier... modifiers) {
    Collections.addAll(this.modifiers, modifiers);
    return this;
}

In contrast, MethodSpec has an additional convenient signature for this method that accepts a Iterable type:

public Builder addModifiers(Iterable<Modifier> modifiers) {
    checkNotNull(modifiers, "modifiers == null");
    for (Modifier modifier : modifiers) {
        this.modifiers.add(modifier);
    }
    return this;
}

I think it is appropriate to enhance FieldSpec and TypeSpec to also have such method signature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant