Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/358#discussion_r81121933
--- Diff:
core/src/main/java/org/apache/brooklyn/core/config/BasicConfigKey.java ---
@@ -331,12 +337,19 @@ public ConfigInheritance getParentInheritance() {
return parentInheritance;
}
+ /** @see ConfigKey#getConstraints() */
+ @Nonnull
+ @Override
+ public Map<String, Predicate<? super T>> getConstraints() {
+ return constraints;
+ }
+
/** @see ConfigKey#getConstraint() */
@Override @Nonnull
public Predicate<? super T> getConstraint() {
// Could be null after rebinding
- if (constraint != null) {
- return constraint;
+ if (constraints.size() > 0) {
+ return Predicates.and(constraints.values());
} else {
return Predicates.alwaysTrue();
}
--- End diff --
Having a name to describe the predicate duplicates the information coming
from the predicate itself. Suggest deciding on whether the predicate means
"required" based on its type name in the REST API.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---