Java 8 has feature called Type annotations (JSR 308). I would like to use it for simple Object to Object mapper framework. I would like define annotation @ExpectedType like this
@Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface SearchDefinition { public String identifier() default ""; }
@SearchDefinition - can be used anywhere