/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, double value) { put(keyStr, FloatData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, boolean value) { put(keyStr, BooleanData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, String value) { put(keyStr, StringData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, boolean value) { put(keyStr, BooleanData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, long value) { put(keyStr, IntegerData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, int value) { put(keyStr, IntegerData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, long value) { put(keyStr, IntegerData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, double value) { put(keyStr, FloatData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, String value) { put(keyStr, StringData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, int value) { put(keyStr, IntegerData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, String value) { put(keyStr, StringData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, boolean value) { put(keyStr, BooleanData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, double value) { put(keyStr, FloatData.forValue(value)); }
/** * Puts data into this data tree at the specified key string. * @param keyStr One or more map keys and/or list indices (separated by '.' if multiple parts). * Indicates the path to the location within this data tree. * @param value The data to put at the specified location. */ public void put(String keyStr, int value) { put(keyStr, IntegerData.forValue(value)); }
/** * Convenience function to put multiple mappings in one call. * @param data The mappings to put, as alternating keys/values. Indices 0, 2, 4, ... must be valid * key strings. Indices 1, 3, 5, ... must be valid Soy data values. * @throws SoyDataException When attempting to add an invalid varargs list or a mapping containing * an invalid key. */ 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() + ")."); } } }
/** * Convenience function to put multiple mappings in one call. * * @param data The mappings to put, as alternating keys/values. Indices 0, 2, 4, ... must be valid * key strings. Indices 1, 3, 5, ... must be valid Soy data values. * @throws SoyDataException When attempting to add an invalid varargs list or a mapping containing * an invalid key. */ 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() + ")."); } } }
/** * Convenience function to put multiple mappings in one call. * * @param data The mappings to put, as alternating keys/values. Indices 0, 2, 4, ... must be valid * key strings. Indices 1, 3, 5, ... must be valid Soy data values. * @throws SoyDataException When attempting to add an invalid varargs list or a mapping containing * an invalid key. */ 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() + ")."); } } }