java - Iterate over an enum, which saves classes, then init the classes and put them into a map -



i have made interface, classes implement, , have enum counstructor takes class<?> arguement. enum(class<?> class), , enum has function return class. how can make class arguement must implement interface, , how later loop through values() of enum, classes, init them , put them hashmap.

thanks help.

use upper bound on wildcard:

class<? extends yourinterface> 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

unity3d - Fatal error- Monodevelop-Unity failed to start -