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
207 * Remove a single value.
209 * @param key the name of the value to remove
223 * Returns true if this object has the named value.
225 * @param key the value to check for
226 * @return {@code true} if the value is present, {@code false} otherwise
233 * Gets a value. Valid value types are {@link String}, {@link Boolean}, and
236 * @param key the value to get
237 * @return the data for the value
244 * Gets a value and converts it to a String.
246 * @param key the value to get
247 * @return the String for the value
250 Object value = mValues.get(key);
251 return value != null ? value.toString() : null;
255 * Gets a value and converts it to a Long.
257 * @param key the value to get
258 * @return the Long value, or null if the value is missing or cannot be converted
261 Object value = mValues.get(key);
263 return value != null ? ((Number) value).longValue() : null;
265 if (value instanceof CharSequence) {
267 return Long.valueOf(value.toString());
269 Log.e(TAG, "Cannot parse Long value for " + value + " at key " + key);
273 Log.e(TAG, "Cannot cast value for " + key + " to a Long: " + value, e);
280 * Gets a value and converts it to an Integer.
282 * @param key the value to get
283 * @return the Integer value, or null if the value is missing or cannot be converted
286 Object value = mValues.get(key);
288 return value != null ? ((Number) value).intValue() : null;
290 if (value instanceof CharSequence) {
292 return Integer.valueOf(value.toString());
294 Log.e(TAG, "Cannot parse Integer value for " + value + " at key " + key);
298 Log.e(TAG, "Cannot cast value for " + key + " to a Integer: " + value, e);
305 * Gets a value and converts it to a Short.
307 * @param key the value to get
308 * @return the Short value, or null if the value is missing or cannot be converted
311 Object value = mValues.get(key);
313 return value != null ? ((Number) value).shortValue() : null;
315 if (value instanceof CharSequence) {
317 return Short.valueOf(value.toString());
319 Log.e(TAG, "Cannot parse Short value for " + value + " at key " + key);
323 Log.e(TAG, "Cannot cast value for " + key + " to a Short: " + value, e);
330 * Gets a value and converts it to a Byte.
332 * @param key the value to get
333 * @return the Byte value, or null if the value is missing or cannot be converted
336 Object value = mValues.get(key);
338 return value != null ? ((Number) value).byteValue() : null;
340 if (value instanceof CharSequence) {
342 return Byte.valueOf(value.toString());
344 Log.e(TAG, "Cannot parse Byte value for " + value + " at key " + key);
348 Log.e(TAG, "Cannot cast value for " + key + " to a Byte: " + value, e);
355 * Gets a value and converts it to a Double.
357 * @param key the value to get
358 * @return the Double value, or null if the value is missing or cannot be converted
361 Object value = mValues.get(key);
363 return value != null ? ((Number) value).doubleValue() : null;
365 if (value instanceof CharSequence) {
367 return Double.valueOf(value.toString());
369 Log.e(TAG, "Cannot parse Double value for " + value + " at key " + key);
373 Log.e(TAG, "Cannot cast value for " + key + " to a Double: " + value, e);
380 * Gets a value and converts it to a Float.
382 * @param key the value to get
383 * @return the Float value, or null if the value is missing or cannot be converted
386 Object value = mValues.get(key);
388 return value != null ? ((Number) value).floatValue() : null;
390 if (value instanceof CharSequence) {
392 return Float.valueOf(value.toString());
394 Log.e(TAG, "Cannot parse Float value for " + value + " at key " + key);
398 Log.e(TAG, "Cannot cast value for " + key + " to a Float: " + value, e);
405 * Gets a value and converts it to a Boolean.
407 * @param key the value to get
408 * @return the Boolean value, or null if the value is missing or cannot be converted
411 Object value = mValues.get(key);
413 return (Boolean) value;
415 if (value instanceof CharSequence) {
416 return Boolean.valueOf(value.toString());
417 } else if (value instanceof Number) {
418 return ((Number) value).intValue() != 0;
420 Log.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e);
427 * Gets a value that is a byte array. Note that this method will not convert
430 * @param key the value to get
431 * @return the byte[] value, or null is the value is missing or not a byte[]
434 Object value = mValues.get(key);
435 if (value instanceof byte[]) {
436 return (byte[]) value;
488 public void putStringArrayList(String key, ArrayList<String> value) {
489 mValues.put(key, value);
510 String value = getAsString(name);
512 sb.append(name + "=" + value);