How can i do this.?

public class CommandProvider implements Provider<Command> {

        public Command get(runtimeValue1, runtimeValue2) {

                if(runtimeValue1.equals( "commandX" )) {

                        return new FooCommandX( runtimeValue2 );

                } else if (runtimeValue1.equals( "commandY" )) {

                        return new FooCommandY(runtimeValue2);

                } else if (runtimeValue1.equals( "commandZ" )) {

                        return new FooCommandZ(runtimeValue2);

                } else {
                    throw new RuntimeException("...."); //For this i
know that i should use ThrowingProviders.
                }

        }

}

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to