I'm working on EWS java api, I want to know if an attachment is of type
something like this
if (attachment is ItemAttachment) // how to in Java api?
if (attachment is FileAttachment) // how to in Java api?
You can use instanceof
:
if (attachment instanceof ItemAttachment) {
...
}