Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. public interface Foo {
  2. void foo(Bar bar);
  3.  
  4. static enum Bar { BAR1, BAR2, BAR3 }
  5. }
  6.  
  7. public interface Foo {
  8. void foo(Bar bar);
  9.  
  10. static class Bar {
  11. private final String id;
  12. public Bar(Sting id) { this.id = id; }
  13. public String getId() { return id; }
  14. }
  15. }
  16.  
  17. public interface Convertor {
  18. String convert(Object arg);
  19. }
  20.  
  21. public interface Convertors {
  22. static class Convertor1 implements Convertor { String convert(Object arg) { /* ... */ }}
  23. static class Convertor2 implements Convertor { String convert(Object arg) { /* ... */ }}
  24. static class Convertor3 implements Convertor { String convert(Object arg) { /* ... */ }}
  25. }
  26.  
  27. public interface Foo {
  28. void foo() throws BarException;
  29.  
  30. static class BarException extends Exception {
  31. // ...
  32. }
  33. }
  34.  
  35. public interface Foo {
  36. Bar foo();
  37.  
  38. static class FooImpl implements Foo {
  39. @Override
  40. public void foo() { return null; }
  41. }
  42. }
  43.  
  44. @Retention(RetentionPolicy.RUNTIME)
  45. public @interface Foo {
  46. // annotation fields
  47.  
  48. static class FooHandler implements Handler<Foo> {
  49. public void handle(Foo foo, Object arg) {
  50. //...
  51. }
  52. }
  53. }
  54.  
  55. public interface Handler<A extends Annotation> {
  56. void handle(A a, Object arg);
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement