Merge branch '2.1.x'

This commit is contained in:
Marcin Grzejszczak
2019-11-08 15:05:01 +01:00
2 changed files with 30 additions and 4 deletions

View File

@@ -44,14 +44,21 @@ public class OptionalProperty implements Serializable, CanBeDynamic {
}
public String value() {
if (this.value == null) {
return valueToCheck(this.value).toString();
}
private Object valueToCheck(Object value) {
if (value == null) {
return "";
}
else if (this.value instanceof RegexProperty) {
return ((RegexProperty) this.value).pattern();
else if (value instanceof ClientDslProperty) {
return valueToCheck(((ClientDslProperty) value).getClientValue());
}
else if (value instanceof RegexProperty || value instanceof Pattern) {
return new RegexProperty(value).pattern();
}
else {
return this.value.toString();
return value.toString();
}
}