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 .