Skip to content
Advertisement

Tag: instanceof

How to check if the type is instanceof an interface in java?

I have a class (CreateAccountRequest) that implement an interface(Iloggable), the interface has no method, Just for marking purpose. In my custom RequestBodyAdviceAdapter class, trying to check if the request is an instance of Iloggable, to proceed or ignore the request (for instance do the logging or not ) I know we can use instanceOf operator to check if an object

Advertisement