Hi,<br><br>&#39;contains&#39; works with collections. You can&#39;t put primitives into a collection in java without wrapping them up in a class like Integer, Long, Short, etc.<br><br><a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html">http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html</a><br>
<br>Cheers,<br>Enda<br><br><div class="gmail_quote">On Wed, Mar 10, 2010 at 9:08 PM, cwolfinger <span dir="ltr">&lt;<a href="mailto:chase.wolfinger@gmail.com" target="_blank">chase.wolfinger@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><br>
Hello - I have a question on how to a contains operation with primitive<br>
values.  What I have is a message that has a field called intTest that is a<br>
List&lt;Integer&gt;.  If i do an intTest contains 4 check, then check compiles but<br>
it never matches.  However if I do an eval it does work.  Does anyone know<br>
how to use a primitive in a contains.<br>
<br>
<br>
Here is a sample of the rule:<br>
<br>
package com.sample<br>
<br>
import com.sample.DroolsTest.Message;<br>
<br>
rule &quot;Test&quot; salience 9999<br>
        #when Message( eval(intTest.contains(Integer.valueOf(4))))<br>
        when Message( intTest contains 4)<br>
        then<br>
        System.out.println(&quot;Found 4&quot;);<br>
end<br>
<font color="#888888">--<br>
View this message in context: <a href="http://n3.nabble.com/Question-on-contains-operator-with-integer-tp440559p440559.html" target="_blank">http://n3.nabble.com/Question-on-contains-operator-with-integer-tp440559p440559.html</a><br>


Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Enda J Diggins<br>