Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/229#discussion_r69448257
--- Diff:
core/src/main/java/org/apache/brooklyn/core/objs/BasicSpecParameter.java ---
@@ -384,5 +387,73 @@ public static WeightedParameter
getFieldConfig(ConfigKey<?> config, Field config
}
}
+ /**
+ * Returns true if the {@link SpecParameter parameter name} is the
same as
+ * that on the specified paramater.
+ */
+ protected static Predicate<SpecParameter<?>> sameName(final
SpecParameter<?> param) {
+ return new Predicate<SpecParameter<?>>() {
+ @Override
+ public boolean apply(SpecParameter<?> input) {
+ return
input.getConfigKey().getName().equals(param.getConfigKey().getName());
+ }
+ };
+ }
+
+ /**
+ * Returns true if the {@link SpecParameter#getLabel() label} is the
same as
+ * the specified string.
+ */
+ public static Predicate<SpecParameter<?>> labelEqualTo(final String
label) {
+ return new Predicate<SpecParameter<?>>() {
--- End diff --
I'd be tempted to move the public methods to a separate
`SpecParameterPredicates` class.
---
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.
---