private void convertConditionRecord(List<Condition> conditions,
            String conditionType, JsonNode conditionNode) {

        Iterator<Map.Entry<String, JsonNode>> mapOfFields = conditionNode
                .fields();
        List<String> values;
        Entry<String, JsonNode> field;
        JsonNode fieldValue;
        Iterator<JsonNode> elements;

        while (mapOfFields.hasNext()) {
            values = new LinkedList<String>();
            field = mapOfFields.next();
            fieldValue = field.getValue();

            if (fieldValue.isArray()) {
                elements = fieldValue.elements();
                while (elements.hasNext()) {
                    values.add(elements.next().asText());
                }
            } else {
                values.add(fieldValue.asText());
            }
            conditions.add(new Condition().withType(conditionType)
                    .withConditionKey(field.getKey()).withValues(values));
        }
    }
Generates a condition instance for each condition type under the
Condition Json node.

@param conditions
           the complete list of conditions
@param conditionType
           the condition type for the condition being created.
@param conditionNode
           each condition node to be parsed.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyReader.java