2016-08-16 40 views
0

我工作的EWS的Java API,我想知道如果附件类型的Java EWS - 如何让附件类型

  • ItemAttachment
  • FileAttachment的

像这样的

if (attachment is ItemAttachment) // how to in Java api? 
if (attachment is FileAttachment) // how to in Java api? 

回答

1

您可以使用instanceof

if (attachment instanceof ItemAttachment) { 
... 
}