private Optional < JsonNode > findPossiblyCuriedEmbeddedNode ( final HalRepresentation halRepresentation , final JsonNode jsonNode , final String rel ) { final JsonNode embedded = jsonNode . get ( "_embedded" ) ; if ( embedded != null ) { final Curies curies = halRepresentation . getCuries ( ) ; final JsonNode curiedNode = embedded . get ( curies . resolve ( rel ) ) ; if ( curiedNode == null ) { return Optional . ofNullable ( embedded . get ( curies . expand ( rel ) ) ) ; } else { return Optional . of ( curiedNode ) ; } } else { return Optional . empty ( ) ; } }
Returns the JsonNode of the embedded items by link - relation type and resolves possibly curied rels .