protected static <T> T getDefault(Class<T> type, Param annot) {
			Object dv = getDefault(annot);
			if (dv == null) {
				return null;
			}
			if (!type.isInstance(dv)) {
				throw new IllegalArgumentException(
					"Type of default does not match that of parameter. Expected type " + type +
						". Got (" + dv.getClass() + ")" + dv);
			}
			return type.cast(dv);
		}
Create a parameter having enumerated choices

@param <T> the type of the parameter
@param type the class representing the type of the parameter
@param name the name of the parameter
@param choices the non-empty set of choices
@param defaultValue the default value of this parameter
@param display the human-readable name of this parameter
@param description the human-readable description of this parameter
@return the new parameter description
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/model/target/iface/TraceObjectMethod.java