2016-08-16 62 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) { 
... 
}