Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Calculator {
- List<Object> getResults();
- List<String> schema();
- }
- default List<String> schema() {
- Schema schema = getClass().getAnnotation(Schema.class);
- if (schema == null) {
- throw new IllegalStateException("Class is missing @Schema annotation: "
- + getClass().getName());
- }
- return schema.getValues();
- }
- @Schema({"e", "pi", "i"})
- public class ScientificCalculator implements Calculator { ... }
Add Comment
Please, Sign In to add comment