Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 921C4200B30 for ; Mon, 4 Jul 2016 14:04:24 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 90AE9160A65; Mon, 4 Jul 2016 12:04:24 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 09C13160A55 for ; Mon, 4 Jul 2016 14:04:23 +0200 (CEST) Received: (qmail 42412 invoked by uid 500); 4 Jul 2016 12:04:23 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 42401 invoked by uid 99); 4 Jul 2016 12:04:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jul 2016 12:04:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8C72DE03C0; Mon, 4 Jul 2016 12:04:22 +0000 (UTC) From: aledsage To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #229: Merge brooklyn.parameters in YAML files Content-Type: text/plain Message-Id: <20160704120422.8C72DE03C0@git1-us-west.apache.org> Date: Mon, 4 Jul 2016 12:04:22 +0000 (UTC) archived-at: Mon, 04 Jul 2016 12:04:24 -0000 Github user aledsage commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/229#discussion_r69448156 --- 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> sameName(final SpecParameter param) { + return new Predicate>() { + @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> labelEqualTo(final String label) { + return new Predicate>() { --- End diff -- Don't use anonymous inner classes, in case they get persisted. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---