|
43 | 43 | * <li> {@link TypeBuilder#ofSubTypes(String...)} </li> |
44 | 44 | * <li> {@link TypeBuilder#ofTypes(String...)} </li> |
45 | 45 | * <li> {@link TypeBuilder#ofType(Predicate<Type>)} </li> |
46 | | - * <li> {@link TypeBuilder#ofAnyType()} // same as ofType(type -> true) </li> |
| 46 | + * <li> {@link TypeBuilder#ofAnyType()} {@code // same as ofType(type -> true)} </li> |
47 | 47 | * </ul> |
48 | 48 | * </li> |
49 | 49 | * <li> a method name |
50 | 50 | * <ul> |
51 | 51 | * <li> {@link NameBuilder#names(String...)} </li> |
52 | 52 | * <li> {@link NameBuilder#constructor()} </li> |
53 | 53 | * <li> {@link NameBuilder#name(Predicate<String>)} </li> |
54 | | - * <li> {@link NameBuilder#anyName()} // same as name(name -> true) </li> |
| 54 | + * <li> {@link NameBuilder#anyName()} {@code // same as name(name -> true)} </li> |
55 | 55 | * </ul> |
56 | 56 | * </li> |
57 | 57 | * <li>a list of parameters, 1 or more call to: |
|
61 | 61 | * <li> {@link ParametersBuilder#addWithoutParametersMatcher()} </li> |
62 | 62 | * <li> {@link ParametersBuilder#addParametersMatcher(String...)} </li> |
63 | 63 | * <li> {@link ParametersBuilder#addParametersMatcher(Predicate<List<Type>>)} </li> |
64 | | - * <li> {@link ParametersBuilder#withAnyParameters()} // same as addParametersMatcher((List<Type> parameters) -> true) </li> |
| 64 | + * <li> {@link ParametersBuilder#withAnyParameters()} {@code // same as addParametersMatcher((List<Type> parameters) -> true)} </li> |
65 | 65 | * </ul> |
66 | 66 | * </li> |
67 | 67 | * </ul> |
68 | 68 | * The matcher will return true only when the three predicates are respected. |
69 | 69 | * <p> |
70 | 70 | * Examples: |
71 | | - * <pre> |
72 | | - *- match method "a" and "b" from any type, and without parameters: |
73 | | - * MethodMatchers.create().ofAnyType().names("a", "b").addWithoutParametersMatcher().build(); |
74 | | - * |
75 | | - *- match method "a" and "b" from (subtype) of A, and "b" and "c" from B, with any parameters: |
76 | | - * MethodMatchers.or( |
| 71 | + * <p> |
| 72 | + * <ul> |
| 73 | + * <li>match method "a" and "b" from any type, and without parameters: |
| 74 | + * {@code MethodMatchers.create().ofAnyType().names("a", "b").addWithoutParametersMatcher().build();} |
| 75 | + * </li> |
| 76 | + * <li>match method "a" and "b" from (subtype) of A, and "b" and "c" from B, with any parameters: |
| 77 | + * <pre> |
| 78 | + * MethodMatchers.or( |
77 | 79 | * MethodMatchers.create().ofSubTypes("A").names("a", "b").withAnyParameters().build(), |
78 | 80 | * MethodMatchers.create().ofSubTypes("B").names("b", "c").withAnyParameters().build()); |
79 | | - *- match method "f" with any type and with: |
80 | | - * MethodMatchers.create().ofAnyType().names("f") |
81 | | - * - one parameter of type either int or long |
82 | | - * .addParametersMatcher("int").addParametersMatcher("long"); |
83 | | - * - one parameter of type int or one parameter of type long with any other number of parameters |
84 | | - * .addParametersMatcher("int").addParametersMatcher(params -> params.size() >= 1 && params.get(0).is("long")); |
85 | | - * .build() |
86 | | - *- match any method with any type, with parameter int, any, int: |
87 | | - * MethodMatchers.create().ofAnyType().anyName().addParametersMatcher("int", ANY, "int").build(); |
88 | | - * |
89 | | - *- match any type AND method name "a" OR "b" AND parameter int OR long: |
90 | | - * MethodMatchers.create().ofAnyType().names("a", "b").addParametersMatcher("int").addParametersMatcher("long").build() |
91 | | - * </pre> |
| 81 | + * </pre> |
| 82 | + * </li> |
| 83 | + * <li> |
| 84 | + * match method "f" with any type and with: |
| 85 | + * {@code MethodMatchers.create().ofAnyType().names("f")} |
| 86 | + * <ul> |
| 87 | + * <li>one parameter of type either {@code int} or {@code long} |
| 88 | + * {@code .addParametersMatcher("int").addParametersMatcher("long");} |
| 89 | + * </li> |
| 90 | + * <li> |
| 91 | + * one parameter of type {@code int} or one parameter of type {@code long} with any other number of parameters |
| 92 | + * {@code .addParametersMatcher("int").addParametersMatcher(params -> params.size() >= 1 && params.get(0).is("long"));} |
| 93 | + * </li> |
| 94 | + * </ul> |
| 95 | + * {@code .build();} |
| 96 | + * </li> |
| 97 | + * <li>match any method with any type, with parameter {@code int, any, int}: |
| 98 | + * {@code MethodMatchers.create().ofAnyType().anyName().addParametersMatcher("int", ANY, "int").build();} |
| 99 | + * </li> |
| 100 | + * <li>match any type AND method name {@code a} OR {@code b} AND parameter {@code int} OR {@code long}: |
| 101 | + * {@code MethodMatchers.create().ofAnyType().names("a", "b").addParametersMatcher("int").addParametersMatcher("long").build();} |
| 102 | + * </li> |
| 103 | + * </ul> |
92 | 104 | */ |
93 | 105 | @Beta |
94 | 106 | public interface MethodMatchers { |
|
0 commit comments