public Mapper < K , V > uniqueKey ( ) { return addConstraint ( new Restraint < K , V > ( ) { @ Override public void checkKeyValue ( K key , V value ) { checkArgument ( ! delegate . get ( ) . containsKey ( key ) , "The key: %s is already exist." , key ) ; } } ) ; }
Add a unique key constraint to this map