Hi

All that generics fuss is fixed in Camel 2.0 as part of our API cleanup.

Glad its working for you and the route is easier to read.


On Wed, Feb 18, 2009 at 2:54 AM, Trevv <4...@safe-mail.net> wrote:
>
> Thanks Claus, that's a good idea.  Using "import static" makes the usage of
> PredicateBuilder.not much easier to read.
>
> When I use your code as-is, I get these warnings:
>
>
> Type safety: Unchecked invocation not(Predicate) of the generic method
> not(Predicate<E>) of type PredicateBuilder
>>
>> Type safety: The expression of type Predicate needs unchecked conversion
>> to conform to Predicate<E>
>
> in Camel 1.5.0.  It's too late in my release cycle to upgrade to Camel 1.6.0
> now.  But that's OK; I can avoid those warnings by using Builder.header
> instead of BuilderSupport.header.
>
> My code now looks like this:
>
>    choice().
>      when(not(Builder.
>                 header("foo").
>                   regex("cheese|whey")))
>
> which is much easier to read than before.
> --
> View this message in context: 
> http://www.nabble.com/How-to-negate-a-Predicate--tp22049751s22882p22070670.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/

Reply via email to