Merge branch '2.1.x'
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user