2016-08-16 3 views
0

ich auf EWS java api gerade arbeite, möchte ich wissen, ob eine Anlage vom TypJava EWS - wie Anlagentyp bekommen

  • ItemAttachment
  • Fileattachment

so etwas wie dieses

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

Antwort

1

können Sie instanceof verwenden:

if (attachment instanceof ItemAttachment) { 
... 
}