Lines Matching refs:value

90      * Adds a value to the set.
92 * @param key the name of the value to put
93 * @param value the data for the value to put
95 public void put(String key, String value) {
96 mValues.put(key, value);
109 * Adds a value to the set.
111 * @param key the name of the value to put
112 * @param value the data for the value to put
114 public void put(String key, Byte value) {
115 mValues.put(key, value);
119 * Adds a value to the set.
121 * @param key the name of the value to put
122 * @param value the data for the value to put
124 public void put(String key, Short value) {
125 mValues.put(key, value);
129 * Adds a value to the set.
131 * @param key the name of the value to put
132 * @param value the data for the value to put
134 public void put(String key, Integer value) {
135 mValues.put(key, value);
139 * Adds a value to the set.
141 * @param key the name of the value to put
142 * @param value the data for the value to put
144 public void put(String key, Long value) {
145 mValues.put(key, value);
149 * Adds a value to the set.
151 * @param key the name of the value to put
152 * @param value the data for the value to put
154 public void put(String key, Float value) {
155 mValues.put(key, value);
159 * Adds a value to the set.
161 * @param key the name of the value to put
162 * @param value the data for the value to put
164 public void put(String key, Double value) {
165 mValues.put(key, value);
169 * Adds a value to the set.
171 * @param key the name of the value to put
172 * @param value the data for the value to put
174 public void put(String key, Boolean value) {
175 mValues.put(key, value);
179 * Adds a value to the set.
181 * @param key the name of the value to put
182 * @param value the data for the value to put
184 public void put(String key, byte[] value) {
185 mValues.put(key, value);
189 * Adds a null value to the set.
191 * @param key the name of the value to make null
218 * Remove a single value.
220 * @param key the name of the value to remove
234 * Returns true if this object has the named value.
236 * @param key the value to check for
237 * @return {@code true} if the value is present, {@code false} otherwise
244 * Gets a value. Valid value types are {@link String}, {@link Boolean},
247 * @param key the value to get
248 * @return the data for the value, or {@code null} if the value is missing or if {@code null}
256 * Gets a value and converts it to a String.
258 * @param key the value to get
259 * @return the String for the value
262 Object value = mValues.get(key);
263 return value != null ? value.toString() : null;
267 * Gets a value and converts it to a Long.
269 * @param key the value to get
270 * @return the Long value, or {@code null} if the value is missing or cannot be converted
273 Object value = mValues.get(key);
275 return value != null ? ((Number) value).longValue() : null;
277 if (value instanceof CharSequence) {
279 return Long.valueOf(value.toString());
281 Log.e(TAG, "Cannot parse Long value for " + value + " at key " + key);
285 Log.e(TAG, "Cannot cast value for " + key + " to a Long: " + value, e);
292 * Gets a value and converts it to an Integer.
294 * @param key the value to get
295 * @return the Integer value, or {@code null} if the value is missing or cannot be converted
298 Object value = mValues.get(key);
300 return value != null ? ((Number) value).intValue() : null;
302 if (value instanceof CharSequence) {
304 return Integer.valueOf(value.toString());
306 Log.e(TAG, "Cannot parse Integer value for " + value + " at key " + key);
310 Log.e(TAG, "Cannot cast value for " + key + " to a Integer: " + value, e);
317 * Gets a value and converts it to a Short.
319 * @param key the value to get
320 * @return the Short value, or {@code null} if the value is missing or cannot be converted
323 Object value = mValues.get(key);
325 return value != null ? ((Number) value).shortValue() : null;
327 if (value instanceof CharSequence) {
329 return Short.valueOf(value.toString());
331 Log.e(TAG, "Cannot parse Short value for " + value + " at key " + key);
335 Log.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e);
342 * Gets a value and converts it to a Byte.
344 * @param key the value to get
345 * @return the Byte value, or {@code null} if the value is missing or cannot be converted
348 Object value = mValues.get(key);
350 return value != null ? ((Number) value).byteValue() : null;
352 if (value instanceof CharSequence) {
354 return Byte.valueOf(value.toString());
356 Log.e(TAG, "Cannot parse Byte value for " + value + " at key " + key);
360 Log.e(TAG, "Cannot cast value for " + key + " to a Byte: " + value, e);
367 * Gets a value and converts it to a Double.
369 * @param key the value to get
370 * @return the Double value, or {@code null} if the value is missing or cannot be converted
373 Object value = mValues.get(key);
375 return value != null ? ((Number) value).doubleValue() : null;
377 if (value instanceof CharSequence) {
379 return Double.valueOf(value.toString());
381 Log.e(TAG, "Cannot parse Double value for " + value + " at key " + key);
385 Log.e(TAG, "Cannot cast value for " + key + " to a Double: " + value, e);
392 * Gets a value and converts it to a Float.
394 * @param key the value to get
395 * @return the Float value, or {@code null} if the value is missing or cannot be converted
398 Object value = mValues.get(key);
400 return value != null ? ((Number) value).floatValue() : null;
402 if (value instanceof CharSequence) {
404 return Float.valueOf(value.toString());
406 Log.e(TAG, "Cannot parse Float value for " + value + " at key " + key);
410 Log.e(TAG, "Cannot cast value for " + key + " to a Float: " + value, e);
417 * Gets a value and converts it to a Boolean.
419 * @param key the value to get
420 * @return the Boolean value, or {@code null} if the value is missing or cannot be converted
423 Object value = mValues.get(key);
425 return (Boolean) value;
427 if (value instanceof CharSequence) {
429 // for booleans is an integer with a value of 0 or 1. Without this check, boolean
432 return Boolean.valueOf(value.toString()) || "1".equals(value);
433 } else if (value instanceof Number) {
434 return ((Number) value).intValue() != 0;
436 Log.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e);
443 * Gets a value that is a byte array. Note that this method will not convert
446 * @param key the value to get
447 * @return the {@code byte[]} value, or {@code null} is the value is missing or not a
451 Object value = mValues.get(key);
452 if (value instanceof byte[]) {
453 return (byte[]) value;
505 public void putStringArrayList(String key, ArrayList<String> value) {
506 mValues.put(key, value);
527 String value = getAsString(name);
529 sb.append(name + "=" + value);