public static void merge(AllowableValueEntity clientAllowableValue, Collection<AllowableValueEntity> allowableValues) { for (AllowableValueEntity allowableValue : allowableValues) { if (clientAllowableValue.getCanRead() && !allowableValue.getCanRead()) { clientAllowableValue.setAllowableValue(allowableValue.getAllowableValue()); clientAllowableValue.setCanRead(allowableValue.getCanRead()); } } } }
private Map<String,ComponentDescriptor> buildComponentDescriptorMap(final ProcessorConfigDTO processorConfig){ final Map<String, ComponentDescriptor> descriptors = new HashMap<>(); for(String key : processorConfig.getDescriptors().keySet()){ PropertyDescriptorDTO descriptor = processorConfig.getDescriptors().get(key); List<AllowableValueEntity> allowableValuesEntity = descriptor.getAllowableValues(); Map<String,String> allowableValues = new HashMap<>(); if(allowableValuesEntity != null) { for (AllowableValueEntity allowableValueEntity : allowableValuesEntity) { final AllowableValueDTO allowableValueDTO = allowableValueEntity.getAllowableValue(); allowableValues.put(allowableValueDTO.getValue(), allowableValueDTO.getDisplayName()); } } ComponentDescriptor componentDescriptor = new ComponentDescriptor.Builder() .name(descriptor.getName()) .displayName(descriptor.getDisplayName()) .defaultValue(descriptor.getDefaultValue()) .allowableValues(allowableValues) .build(); descriptors.put(key,componentDescriptor); } return descriptors; }