Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add builder-style annotation creation method #4

Open
thecodewarrior opened this issue Jul 23, 2019 · 0 comments
Open

Add builder-style annotation creation method #4

thecodewarrior opened this issue Jul 23, 2019 · 0 comments

Comments

@thecodewarrior
Copy link
Owner

Currently the two annotation creation methods accessible from java take pairs and a map as parameters. A much more convenient version could be done with a builder style:

Contract contractAnnotation = Mirror.newAnnotation(Contract.class,
    new Pair<>("value", "_, null -> null"),
    new Pair<>("pure", true)
);
// vs
Contract contractAnnotation = Mirror.newAnnotation(Contract.class)
    .set("value", "_, null -> null")
    .set("pure", true)
    .build();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant