/** * 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)); }
public static NumberData $$negative(NumberData operand) { if (operand instanceof IntegerData) { return IntegerData.forValue( - operand.integerValue() ); } else { return FloatData.forValue( - operand.floatValue() ); } }
public static NumberData $$times(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.integerValue() * operand1.integerValue()); } else { return FloatData.forValue(operand0.numberValue() * operand1.numberValue()); } }
/** * 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)); }
public static BooleanData $$lessThan(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() < operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() < operand1.numberValue()); } }
/** Performs the {@code +} operator on the two values. */ public static SoyValue plus(SoyValue operand0, SoyValue operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.longValue() + operand1.longValue()); } else if (operand0 instanceof NumberData && operand1 instanceof NumberData) { return FloatData.forValue(operand0.numberValue() + operand1.numberValue()); } else { // String concatenation is the fallback for other types (like in JS). Use the implemented // coerceToString() for the type. return StringData.forValue(operand0.coerceToString() + operand1.coerceToString()); } }
/** * 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, 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)); }
public static BooleanData $$lessThanOrEqual(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() <= operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() <= operand1.numberValue()); } }
public static NumberData $$minus(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return IntegerData.forValue(operand0.integerValue() - operand1.integerValue()); } else { return FloatData.forValue(operand0.numberValue() - operand1.numberValue()); } }
/** * 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, 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, boolean value) { put(keyStr, BooleanData.forValue(value)); }
public static BooleanData $$greaterThanOrEqual(NumberData operand0, NumberData operand1) { if (operand0 instanceof IntegerData && operand1 instanceof IntegerData) { return BooleanData.forValue(operand0.integerValue() >= operand1.integerValue()); } else { return BooleanData.forValue(operand0.numberValue() >= operand1.numberValue()); } }
/** * 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, 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, long value) { put(keyStr, IntegerData.forValue(value)); }