Changeset 10 for references
- Timestamp:
- 01/28/20 10:19:54 (5 years ago)
- Location:
- references/src/main/java/geniusweb/references
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
references/src/main/java/geniusweb/references/Parameters.java
r8 r10 11 11 public class Parameters extends HashMap<String, Object> { 12 12 13 /** 14 * Getter with type-check 15 * 16 * @param <T> the expected type 17 * @param paramname the parameter name that must be in the map 18 * @param classType the expected value type for this parameter 19 * @return object of requested type. 20 * @throws IllegalArgumentException if the object is not available. 21 */ 22 @SuppressWarnings("unchecked") 23 public <T> T get(String paramname, Class<T> classType) { 24 if (!containsKey(paramname) 25 || !(get(paramname).getClass().isInstance(classType))) 26 throw new IllegalArgumentException(" Missing contain a parameter " 27 + paramname + " with a " + classType.getName() + " value"); 28 return (T) get(paramname); 29 } 13 30 } -
references/src/main/java/geniusweb/references/PartyWithProfile.java
r8 r10 22 22 } 23 23 24 /** 25 * 26 * @return the {@link PartyWithParameters}. never null. 27 */ 24 28 public PartyWithParameters getParty() { 25 29 return party; … … 27 31 } 28 32 33 /** 34 * @return the profile setting for this party. Never null. 35 */ 29 36 public ProfileRef getProfile() { 30 37 return profile;
Note:
See TracChangeset
for help on using the changeset viewer.