*/
public void put(Object... data) {
// TODO: Perhaps change to only convert varargs to Map, and do put(Map) elsewhere.
if (data.length % 2 != 0) {
throw new SoyDataException(
"Varargs to put(...) must have an even number of arguments (key-value pairs).");
}
for (int i = 0; i < data.length; i += 2) {
try {
put((String) data[i], SoyData.createFromExistingData(data[i + 1]));
} catch (ClassCastException cce) {
throw new SoyDataException(
"Attempting to add a mapping containing a non-string key (key type " +
data[i].getClass().getName() + ").");
}
}
}