Hi

Oh the remaining minor issue is whether we should also change the
ObjectHelper.notNull method name to be aligned with the isXXX methods

From:
ObjectHelper.notNull

To
ObjectHelper.notEmpty

As it's used in many components I didn't change the name right away.

Any objections, otherwise I might fix when I need to do some trivial work ;)


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Wed, Dec 10, 2008 at 12:48 PM, Claus Ibsen <[EMAIL PROTECTED]> wrote:
> Hi
>
> Ticket: CAMEL-1155
>
> #1
> I have aligned the various isNotNullOrNonEmpty / isBlank etc. methods
> in ObjectHelper into two combined methods.
>
> These old methods have been removed in Camel 2.0
> - isNotNullAndNonEmpty
> - isNullOrBlank
>
> And replaced with (see below)
>
> #2
> I have also refined the notNull methods to use these new test methods
> so we test for both null and if its a String type if the string is
> empty as well.
>
> I have added a variation of the notNull tester with a 3rd parameter =
> on. This parameter is appended to the message being thrown. This helps
> end users to identify where the problem is.
> In the various model types we can use this 3 parameter passing in
> *this*. So the error reported will output the toString of the node, so
> it's like
>
> For instance this route will use a bean with the id=hello
> from("direct:in").processRef("hello");
>
> But if the bean is not in the registry you now get this error message:
>     registry entry called hello must be specified on: process[ref: hello]
> Instead of just:
>     registry entry called hello must be specified
>
>
>
> New methods to use
> ===============
>
>    public static void notNull(Object value, String name, Object on) {
>
>
>    /**
>     * Tests whether the value is <tt>null</tt> or an empty string.
>     *
>     * @param value the value, if its a String it will be tested for
> text length as well
>     * @return true if empty
>     */
>    public static boolean isEmpty(Object value) {
>
>    /**
>     * Tests whether the value is <b>not</b> <tt>null</tt> or an empty string.
>     *
>     * @param value the value, if its a String it will be tested for
> text length as well
>     * @return true if <b>not</b> empty
>     */
>    public static boolean isNotEmpty(Object value) {
>
>
>
>
>
> /Claus Ibsen
> Apache Camel Committer
> Blog: http://davsclaus.blogspot.com/
>

Reply via email to