Custom annotation - Required and Nullable

I want to create a custom annotation in java which should do the following check on any field

Check that the field is required

Even if it's required we can pass the value as null or empty.

Both the above condition should be satisfied using one annotation

I know that it can easily be done using existing java libraries, but for my use-case I need it to be made using custom annotation.

For example below code should be able to do the check as:

@MyCustomAnnotation

private String address

address is required but can be passed as null or...

Read More »

By: StackOverFlow - Saturday, 14 April

Related Posts