Annotations
Paired
@Paired(Field.class)
public @interface Foreign {
}// Correct way of using your annotation.
public @Field @Foreign int number;
// This will now throw an error.
// You will need to implement the checker tho.
public @Foreign int number;@Test
public void testPaired() {
boolean isUsedCorrectly = Paired.Checker.isUsedCorrectly("your.package");
if (!isUsedCorrectly) throw new Exception();
}Last updated