File tree Expand file tree Collapse file tree
xapi-client/src/main/java/dev/learning/xapi/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -164,14 +164,16 @@ private List<Object> getParts(Object object) {
164164
165165 final var list = new ArrayList <>();
166166
167- final Stream <Attachment > attachments =
168- switch (object ) {
169- case Statement statement -> getRealAttachments (statement );
170- case List <?> statements
171- when !statements .isEmpty () && statements .get (0 ) instanceof Statement ->
172- ((List <Statement >) statements ).stream ().flatMap (this ::getRealAttachments );
173- default -> null ;
174- };
167+ final Stream <Attachment > attachments ;
168+
169+ if (object instanceof Statement statement ) {
170+ attachments = getRealAttachments (statement );
171+ } else if (object instanceof List <?> statements
172+ && !statements .isEmpty () && statements .get (0 ) instanceof Statement ) {
173+ attachments = ((List <Statement >) statements ).stream ().flatMap (this ::getRealAttachments );
174+ } else {
175+ attachments = null ;
176+ }
175177
176178 if (attachments == null ) {
177179 // The object is not a statement or list of statements
You can’t perform that action at this time.
0 commit comments