String buildUpdateExpression ( SubstitutionContext context ) { StringBuilder sb = new StringBuilder ( ) ; for ( Map . Entry < String , List < UpdateAction > > e : updates . entrySet ( ) ) { boolean firstOfUpdateType = true ; for ( UpdateAction expr : e . getValue ( ) ) { if ( firstOfUpdateType ) { firstOfUpdateType = false ; final String operator = e . getKey ( ) ; if ( sb . length ( ) > 0 ) sb . append ( " " ) ; sb . append ( operator ) . append ( " " ) ; } else { sb . append ( ", " ) ; } sb . append ( expr . asSubstituted ( context ) ) ; } } return sb . toString ( ) ; }
Builds and returns the update expression to be used in a dynamodb request ; or null if there is none .