java - Pass Class as parameter and return same class object -


i want pass class parameter , return same class parameter. parameter can of class. want comman method in need pass object of particular class , give me same object return. know java - generics or java collection possible don't know how?

code:

 public class_object_as_paramter(parent) webcall(class obj parameter(parent))                 throws jsonsyntaxexception, ioexception, xmlpullparserexception {             gsonbuilder gsonbuilder = new gsonbuilder();             gson gson = gsonbuilder.create();              parent = (collection<?>) gson.fromjson(soaplcalls                     .getuserwisesalescontracts(gsonexample.this, "55000024"),                     parentsalescontract.class (also has pass same class here);             return parent;         } 

create generic method this:

<t> t method(t t) {     ...     t tt = ...     return tt; } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

IIS->Tomcat Redirect: multiple worker with default -