0

I'm working on EWS java api, I want to know if an attachment is of type

  • ItemAttachment
  • FileAttachment

something like this

 if (attachment is ItemAttachment) // how to in Java api?
 if (attachment is FileAttachment) // how to in Java api?
Lucky
  • 783
  • 2
  • 10
  • 28

1 Answers1

1

You can use instanceof:

if (attachment instanceof ItemAttachment) {
...
}
Piotr Wilkin
  • 3,446
  • 10
  • 18