// One bucket type is the state where the user is currently located.
switch(city) {
case PORTLAND:
case SALEM:
// These cities are in Oregon
mapBuilder.put(usState, new EnumSerializable(UsState.OREGON, 1));
break;
case SANFRANCISCO:
case SACRAMENTO:
// These cities are in California
mapBuilder.put(usState, new EnumSerializable(UsState.CALIFORNIA, 1));
break;
case OLYMPIA:
case SEATTLE:
// These cities are in Washington
mapBuilder.put(usState, new EnumSerializable(UsState.WASHINGTON, 1));
break;
default:
throw new RuntimeException("Unknown city " + city);
}
// The other bucket type is the city where the user is currently located.
mapBuilder.put(usCity, new EnumSerializable(city, 1));
return mapBuilder.build();
}