Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 725E1175FD for ; Wed, 28 Jan 2015 19:36:37 +0000 (UTC) Received: (qmail 47299 invoked by uid 500); 28 Jan 2015 19:36:37 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 47114 invoked by uid 500); 28 Jan 2015 19:36:36 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 47030 invoked by uid 99); 28 Jan 2015 19:36:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jan 2015 19:36:36 +0000 Date: Wed, 28 Jan 2015 19:36:36 +0000 (UTC) From: "lucas theisen (JIRA)" To: dev@directory.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DIRAPI-165) Add a FilterBuillder MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRAPI-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14295693#comment-14295693 ] lucas theisen commented on DIRAPI-165: -------------------------------------- I would probably throw an {{IllegalArgumentException}} in the empty array case. What you have is _nicer_ but if they really did provide an empty list to a {{startsWith}, its a REALLY good chance they made a mistake. You could enforce it compile time with a: {code} public static SubstringFilter startswith( String attribute, String init, String... parts ) {code} but I would not do that because there would be no way to ensure this for {{endsWith}} and I like the idea of all of them having the same argument list. I think fail fast with the exception would be best. Finally, you probably meant to camelCase {{startsWith}}... > Add a FilterBuillder > -------------------- > > Key: DIRAPI-165 > URL: https://issues.apache.org/jira/browse/DIRAPI-165 > Project: Directory Client API > Issue Type: New Feature > Affects Versions: 1.0.0-M21 > Reporter: lucas theisen > Priority: Minor > Fix For: 1.0.0-M29 > > > Looking for something Fluent, in the _spirit_ of Hibernate Criteria. May not seem like much, but can drastically reduce query syntax issues. Also, you would likely be using a StringBuilder anyway, so its not much different. -- This message was sent by Atlassian JIRA (v6.3.4#6332)