<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Generic classes in ivyscript</title><link>https://answers.axonivy.com/questions/531/generic-classes-in-ivyscript</link><description>&lt;p&gt;Hello IvyTeam&lt;/p&gt;
&lt;p&gt;Is there a simple way calling self made generic classes? Like the List.&lt;/p&gt;
&lt;p&gt;Data:&lt;br&gt;
dao Dao&amp;lt;item&amp;gt;&lt;/p&gt;
&lt;p&gt;in Ivyscript:&lt;br&gt; calling dao.get(id) the response would be of type Item.&lt;/p&gt;
&lt;p&gt;generic Class:&lt;br&gt;
T get(int id)&lt;/p&gt;
&lt;p&gt;It would be great if there is a solution.&lt;/p&gt;
&lt;p&gt;Thanks for an answer and Greetings&lt;/p&gt;
&lt;p&gt;Edit:
Trying to extend a class with the Generic doesn't help any further.&lt;br&gt;
In java code those objects return items as it should and in ivyscript Objects are still returned.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class DaoItemTest extends Dao&amp;lt;Item&amp;gt; {
    public DaoItemTest() {
        super(Item.class);
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><atom:link href="https://answers.axonivy.com/questions/531/generic-classes-in-ivyscript" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 20 Feb 2014 08:56:52 -0500</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/531/generic-classes-in-ivyscript/537</link><description>&lt;p&gt;At the moment IvyScript can handle Generics only on its own List&amp;lt;?&amp;gt; class. On all other classes Generics are ignored. There is already a feature request for this. See issue 
18147. As a workaround you can cast the result of the generic method to the right type:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;item myItem = dao.get(0) as item;
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Thu, 20 Feb 2014 08:56:52 -0500</pubDate><guid>https://answers.axonivy.com/questions/531/generic-classes-in-ivyscript/537</guid></item></channel></rss>