Changeset 10 for references/src


Ignore:
Timestamp:
01/28/20 10:19:54 (4 years ago)
Author:
bart
Message:

Update 28 jan 2020

Location:
references/src/main/java/geniusweb/references
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • references/src/main/java/geniusweb/references/Parameters.java

    r8 r10  
    1111public class Parameters extends HashMap<String, Object> {
    1212
     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        }
    1330}
  • references/src/main/java/geniusweb/references/PartyWithProfile.java

    r8 r10  
    2222        }
    2323
     24        /**
     25         *
     26         * @return the {@link PartyWithParameters}. never null.
     27         */
    2428        public PartyWithParameters getParty() {
    2529                return party;
     
    2731        }
    2832
     33        /**
     34         * @return the profile setting for this party. Never null.
     35         */
    2936        public ProfileRef getProfile() {
    3037                return profile;
Note: See TracChangeset for help on using the changeset viewer.