<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Java's generics are implemented by erasure,<br>
    which implies that there no information available at runtime that a
    instance of a List is of a certain generic type, for example Boost.<br>
    So I don't think this is possible.<br>
    <br>
    Note that some things do work in erasure IIRC, like the generic type
    of a defined field in a class is available at runtime:<br>
    public class Foo {<br>
    &nbsp; private List&lt;Bar&gt; list;<br>
    }<br>
    but that's not useful in this case :)<br>
    <br>
    Op 17-10-11 11:30, Martin A schreef:
    <blockquote
cite="mid:CAB27Hf3PbJEtaTODDZtKSWQRfMyPcnzCn=RQ=NFdU5gohUSe5g@mail.gmail.com"
      type="cite">Hello,
      <div><br>
      </div>
      <div>In my rules file I'd like to set something like this:</div>
      <div><br>
      </div>
      <div>
        <div>rule "mayThrowDice"</div>
        <div>&nbsp; &nbsp; when</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; $user : User($gp : gameplay)</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; $gameplay(this == $gp)</div>
        <div>&nbsp; &nbsp; then</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; exists List&lt;Boost&gt;() {</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ..... some business logic</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
        <div>end</div>
      </div>
      <div><br>
      </div>
      <div>But it looks like there is no generics support. How can I
        make sure there is a List of type Boost inserted into the
        session?</div>
      <div><br>
      </div>
      <div>Thank you,</div>
      <div>Martin</div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
With kind regards,
Geoffrey De Smet</pre>
  </body>
</html>