/** * Looks up the given key in the given map, converting the result into * a long, using the default value if the the conversion fails. * * @param map the map whose value to look up * @param key the key of the value to look up in that map * @param defaultValue what to return if the value is null or if the * conversion fails * @return the value in the map as a number, or defaultValue if the * original value is null, the map is null or the number conversion * fails */ public static Long getLong( Map map, Object key, Long defaultValue ) { Long answer = getLong( map, key ); if ( answer == null ) { answer = defaultValue; } return answer; }
/** * Looks up the given key in the given map, converting the result into * a long, using the default value if the the conversion fails. * * @param map the map whose value to look up * @param key the key of the value to look up in that map * @param defaultValue what to return if the value is null or if the * conversion fails * @return the value in the map as a number, or defaultValue if the * original value is null, the map is null or the number conversion * fails */ public static Long getLong( Map map, Object key, Long defaultValue ) { Long answer = getLong( map, key ); if ( answer == null ) { answer = defaultValue; } return answer; }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner, * using the default value if the the conversion fails. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the * conversion fails * @return the value in the Map as a long, <code>defaultValue</code> if null map input */ public static long getLongValue(final Map map, final Object key, long defaultValue) { Long longObject = getLong(map, key); if (longObject == null) { return defaultValue; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner, * using the default value if the the conversion fails. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the * conversion fails * @return the value in the Map as a long, <code>defaultValue</code> if null map input */ public static long getLongValue(final Map map, final Object key, long defaultValue) { Long longObject = getLong(map, key); if (longObject == null) { return defaultValue; } return longObject.longValue(); }
public static <T, V> Long getLong(Map<T, V> map, String key) { return MapUtils.getLong(map, key); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @return the value in the Map as a long, <code>0L</code> if null map input */ public static long getLongValue(final Map map, final Object key) { Long longObject = getLong(map, key); if (longObject == null) { return 0L; } return longObject.longValue(); }
/** * Gets a long from a Map in a null-safe manner, * using the default value if the the conversion fails. * <p> * The long is obtained from the results of {@link #getNumber(Map,Object)}. * * @param map the map to use * @param key the key to look up * @param defaultValue return if the value is null or if the * conversion fails * @return the value in the Map as a long, <code>defaultValue</code> if null map input */ public static long getLongValue(final Map map, final Object key, long defaultValue) { Long longObject = getLong(map, key); if (longObject == null) { return defaultValue; } return longObject.longValue(); }
@Override // map merge public Map<String, Long> combine(Map<String, Long> val1, Map<String, Long> val2) { for(Map.Entry<String, Long> entry : val2.entrySet()) { val2.put(entry.getKey(), MapUtils.getLong(val1, entry.getKey(), 0L) + entry.getValue()); } for(Map.Entry<String, Long> entry : val1.entrySet()) { if(val2.containsKey(entry.getKey())) { continue; } val2.put(entry.getKey(), entry.getValue()); } return val2; }
public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); }
public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); }
public Long getMultipartCopyThreshold() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_THRESHOLD.keyName(), null); }
public Long getMultipartCopyPartSize() { return MapUtils.getLong(copierOptions, Keys.MULTIPART_COPY_PART_SIZE.keyName(), null); }
public List multiGet(List<List<Object>> keys) { List<TransactionalValue<Long>> result = new ArrayList<TransactionalValue<Long>>(keys.size()); for (int i = 0; i < keys.size(); i++) { TridentTuple key = (TridentTuple) keys.get(i); result.add(new TransactionalValue<Long>(0L, MapUtils.getLong(handler.getState(), key.getString(0), 0L))); } return result; }
@SuppressWarnings("rawtypes") public static Object getLong(ActionContext actionContext){ Thing self = actionContext.getObject("self"); Map map = (Map) self.doAction("getMap", actionContext); Object key = self.doAction("getKey", actionContext); Object result = MapUtils.getLong(map, key); if(result == null){ return self.doAction("getDefaultValue", actionContext); }else{ return result; } }