/** * Null-safe check if the specified map is not empty. * <p> * Null returns false. * * @param map the map to check, may be null * @return true if non-null and non-empty * @since 3.2 */ public static boolean isNotEmpty(final Map<?,?> map) { return !MapUtils.isEmpty(map); }
void addWriting(Map<DataWord, DataWord> entries) { if (MapUtils.isEmpty(entries)) return; for (Map.Entry<DataWord, DataWord> entry : entries.entrySet()) { add(entry, true); } }
void addReading(Map<DataWord, DataWord> entries) { if (MapUtils.isEmpty(entries)) return; for (Map.Entry<DataWord, DataWord> entry : entries.entrySet()) { if (!this.entries.containsKey(entry.getKey())) add(entry, false); } }
if (shouldRecompress && MapUtils.isEmpty(convertedParameters)) { convertedParameters.put("recompress","true");
Map<String, String> additionalFields = customerPayment.getAdditionalFields(); if (gatewayType == null || paymentType == null) { if (MapUtils.isEmpty(additionalFields)) { additionalFields = new HashMap<>();
private int getWeight(String providerRegion, RegionWeightEntity regionWeightEntity) { if (regionWeightEntity == null) { return -1; } Map<String, Integer> weightMap = regionWeightEntity.getWeightMap(); if (MapUtils.isEmpty(weightMap)) { return -1; } Integer weight = weightMap.get(providerRegion); if (weight != null) { return weight; } else { return -1; } }
private int getWeight(String providerRegion, RegionWeightEntity regionWeightEntity) { if (regionWeightEntity == null) { return -1; } Map<String, Integer> weightMap = regionWeightEntity.getWeightMap(); if (MapUtils.isEmpty(weightMap)) { return -1; } Integer weight = weightMap.get(providerRegion); if (weight != null) { return weight; } else { return -1; } }
private int getWeight(String consumerServiceId, String providerServiceId, String providerVersion, Map<String, List<WeightEntity>> weightEntityMap) { if (MapUtils.isEmpty(weightEntityMap)) { return -1; } List<WeightEntity> weightEntityList = weightEntityMap.get(consumerServiceId); if (CollectionUtils.isEmpty(weightEntityList)) { return -1; } for (WeightEntity weightEntity : weightEntityList) { String providerServiceName = weightEntity.getProviderServiceName(); if (StringUtils.equalsIgnoreCase(providerServiceName, providerServiceId)) { Map<String, Integer> weightMap = weightEntity.getWeightMap(); if (MapUtils.isEmpty(weightMap)) { return -1; } Integer weight = weightMap.get(providerVersion); if (weight != null) { return weight; } else { return -1; } } } return -1; }
private int getWeight(String consumerServiceId, String providerServiceId, String providerVersion, Map<String, List<WeightEntity>> weightEntityMap) { if (MapUtils.isEmpty(weightEntityMap)) { return -1; } List<WeightEntity> weightEntityList = weightEntityMap.get(consumerServiceId); if (CollectionUtils.isEmpty(weightEntityList)) { return -1; } for (WeightEntity weightEntity : weightEntityList) { String providerServiceName = weightEntity.getProviderServiceName(); if (StringUtils.equalsIgnoreCase(providerServiceName, providerServiceId)) { Map<String, Integer> weightMap = weightEntity.getWeightMap(); if (MapUtils.isEmpty(weightMap)) { return -1; } Integer weight = weightMap.get(providerVersion); if (weight != null) { return weight; } else { return -1; } } } return -1; }
private Map<String, String> getCustomMap(String serviceId) { RuleEntity ruleEntity = pluginAdapter.getRule(); if (ruleEntity == null) { return null; } CustomizationEntity customizationEntity = ruleEntity.getCustomizationEntity(); if (customizationEntity == null) { return null; } Map<String, Map<String, String>> customizationMap = customizationEntity.getCustomizationMap(); if (MapUtils.isEmpty(customizationMap)) { return null; } return customizationMap.get(serviceId); } }
if (MapUtils.isEmpty(versionEntityMap)) { return;
if (MapUtils.isEmpty(versionEntityMap)) { return;
private boolean policyExists(String policyId) { if (MapUtils.isEmpty(prePolicies)) { log.error("No PreDownloadPolicies found!"); return false; } if (MapUtils.isEmpty(postPolicies)) { log.error("No PostDownloadPolicies found!"); return false; } return (prePolicies.containsKey(policyId) || postPolicies.containsKey(policyId) || downloadErrorPolicies.containsKey(policyId)); }
/** * @return joined by "&" sign URL params, or empty string if no params for this state */ public String getParamsString() { if (MapUtils.isEmpty(params)) { return ""; } return params.entrySet() .stream() .map(entry -> String.format("%s=%s", entry.getKey(), entry.getValue())) .collect(Collectors.joining("&")); }
/** * 하위 호환을 위하여 처리 */ public Map<String, Host> getHosts() { if (MapUtils.isEmpty(hosts) && loader != null) { return loader.getHosts(); } return hosts; }
/** * 하위 호환을 위하여 처리 */ public Map<String, Host> getHosts() { if (MapUtils.isEmpty(hosts) && loader != null) { return loader.getHosts(); } return hosts; }
private List<RuntimeException> validateRawData(Map<String, Object> rawData) { if (MapUtils.isEmpty(rawData)) { return Collections.singletonList(new RuntimeException("Step has no reference information.")); } else if (rawData.size() > 1) { return Collections.singletonList( new RuntimeException("Step has too many keys under the '" + keyToTransform() + "' keyword,\n" + "May happen due to wrong indentation.")); } executableValidator.validateStepReferenceId(rawData.keySet().iterator().next()); return Collections.emptyList(); } }
public Map<String, Object> findTuningOptionMap(IngestionOption.IngestionType ingestionEnumType, Map<String, Object> overrideOptions) { Map<String, Object> tuningOptions = findIngestionOptions(IngestionOption.OptionType.TUNING, ingestionEnumType) .stream().collect(Collectors.toMap(k -> k.getName(), v -> v.defaultValueByType())); if (MapUtils.isEmpty(overrideOptions)) { return tuningOptions; } for (String key : overrideOptions.keySet()) { tuningOptions.put(key, overrideOptions.get(key)); } return tuningOptions; }
@Inject public AbstractItemPreviewComponent(SimpleTranslator i18n, PropertySetFactory<T> propertySetFactory, PreviewProvider<T> previewProvider, Map<String, Class> properties) { if (MapUtils.isEmpty(properties)) { throw new IllegalArgumentException("Map containing properties to be displayed can't be empty or null."); } this.previewProvider = previewProvider; this.i18n = i18n; this.propertySet = propertySetFactory.withProperties(properties); this.rootLayout = new HorizontalLayout(); setCompositionRoot(rootLayout); }
public Map<String, String> retrieveFromSentinel(String traceId) throws Exception { Jedis jedis = RedisSentinelPoolFactory.getResource(); if (jedis == null) { throw new MonitorException("No redis sentinel resource found, retrieve failed"); } Map<String, String> monitorStatMap = jedis.hgetAll(traceId); if (MapUtils.isEmpty(monitorStatMap)) { return null; } return monitorStatMap; }