Created
March 14, 2011 23:53
-
-
Save thuss/870094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.vm.web; | |
import java.util.*; | |
/** | |
* @author thuss | |
*/ | |
public class CollectionStuff { | |
private Map<String, String> redirects = new HashMap<String, String>() {{ | |
put("/login.jsp", "/login"); | |
put("/logout.jsp", "/logout"); | |
}}; | |
private List<String> states = new ArrayList<String>() {{ | |
add("CA"); | |
add("WA"); | |
}}; | |
private List<String> statesAlternative = Arrays.asList("CA", "WA"); | |
public boolean isValidState(String state) { | |
return states.contains(state); | |
} | |
public String getRedirect(String path) { | |
return redirects.get(path); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment