- List<MatchType> matchList = allOfType.getMatch();
- if (matchList != null) {
- //
- // Under the match we have attributeValue and
- // attributeDesignator. So,finally down to the actual attribute.
- //
- // Component attributes are saved under Target here we are fetching them back.
- // One row is default so we are not adding dynamic component at index 0.
- matchList.forEach(match -> {
- AttributeValueType attributeValue = match.getAttributeValue();
- String value = (String) attributeValue.getContent().get(0);
- AttributeDesignatorType designator = match.getAttributeDesignator();
- String attributeId = designator.getAttributeId();
- Map<String, String> attribute = new HashMap<>();
- attribute.put("key", attributeId);
- attribute.put("value", value);
- attributeList.add(attribute);
- });
+ //
+ // NOTE: allOfType.getMatch() will NEVER be null as the method
+ // call getMatch will always return something. If its
+ // not there it will create it.
+ //
+ //
+ // Under the match we have attributeValue and
+ // attributeDesignator. So,finally down to the actual attribute.
+ //
+ // Component attributes are saved under Target here we are fetching them back.
+ // One row is default so we are not adding dynamic component at index 0.
+ for (MatchType match : allOfType.getMatch()) {
+ AttributeValueType attributeValue = match.getAttributeValue();
+ String value = (String) attributeValue.getContent().get(0);
+ AttributeDesignatorType designator = match.getAttributeDesignator();
+ String attributeId = designator.getAttributeId();
+ Map<String, String> attribute = new HashMap<>();
+ attribute.put("key", attributeId);
+ attribute.put("value", value);
+ attributeList.add(attribute);