public TableKeysAndAttributes addHashAndRangePrimaryKeys ( String hashKeyName , String rangeKeyName , Object ... alternatingHashRangeKeyValues ) { if ( alternatingHashRangeKeyValues . length % 2 != 0 ) { throw new IllegalArgumentException ( "The multiple hash and range key values must alternate" ) ; } for ( int i = 0 ; i < alternatingHashRangeKeyValues . length ; i += 2 ) { Object hashKeyValue = alternatingHashRangeKeyValues [ i ] ; Object rangeKeyValue = alternatingHashRangeKeyValues [ i + 1 ] ; this . addPrimaryKey ( new PrimaryKey ( ) . addComponent ( hashKeyName , hashKeyValue ) . addComponent ( rangeKeyName , rangeKeyValue ) ) ; } return this ; }
Adds multiple hash - and - range primary keys to be included in the batch get - item operation .