Fixed issue to show property dependent on default value of another
This closes
@@ -1556,8 +1556,8 @@ public final class DtoFactory {
orderedProperties.putAll(sortedProperties);
// build the descriptor and property dtos
- dto.setDescriptors(new LinkedHashMap<String, PropertyDescriptorDTO>());
- dto.setProperties(new LinkedHashMap<String, String>());
+ dto.setDescriptors(new LinkedHashMap<>());
+ dto.setProperties(new LinkedHashMap<>());
for (final Map.Entry<PropertyDescriptor, String> entry : orderedProperties.entrySet()) {
final PropertyDescriptor descriptor = entry.getKey();
@@ -1568,6 +1568,8 @@ public final class DtoFactory {
String propertyValue = entry.getValue();
if (propertyValue != null && descriptor.isSensitive()) {
propertyValue = SENSITIVE_VALUE_MASK;
+ } else if (propertyValue == null && descriptor.getDefaultValue() != null) {
+ propertyValue = descriptor.getDefaultValue();
}
// set the property value
@@ -1636,8 +1638,8 @@ public final class DtoFactory {
orderedProperties.putAll(sortedProperties);
// build the descriptor and property dtos
- dto.setDescriptors(new LinkedHashMap<String, PropertyDescriptorDTO>());
- dto.setProperties(new LinkedHashMap<String, String>());
+ dto.setDescriptors(new LinkedHashMap<>());
+ dto.setProperties(new LinkedHashMap<>());
for (final Map.Entry<PropertyDescriptor, String> entry : orderedProperties.entrySet()) {
final PropertyDescriptor descriptor = entry.getKey();
@@ -1649,6 +1651,8 @@ public final class DtoFactory {
String propertyValue = entry.getValue();
if (propertyValue != null && descriptor.isSensitive()) {
propertyValue = SENSITIVE_VALUE_MASK;
+ } else if (propertyValue == null && descriptor.getDefaultValue() != null) {
+ propertyValue = descriptor.getDefaultValue();
}
// set the property value
