207 208 /** 209 * Retrieve a copy of this object's parameter list. 210 */ 211 public MimeTypeParameterList getParameters() { 212 return (MimeTypeParameterList)parameters.clone(); 213 } 214 215 /** 216 * Retrieve the value associated with the given name, or null if there 217 * is no current association. 218 */ 219 public String getParameter(String name) { 220 return parameters.get(name); 221 } 222 223 /** 224 * Set the value to be associated with the given name, replacing 225 * any previous association. 226 * 227 * @throw IllegalArgumentException if parameter or value is illegal 228 */ 229 public void setParameter(String name, String value) { 230 parameters.set(name, value); 231 } 232 233 /** 234 * Remove any value associated with the given name. 235 * 236 * @throw IllegalArgumentException if parameter may not be deleted 237 */ 238 public void removeParameter(String name) { 239 parameters.remove(name); 240 } 241 242 /** 243 * Return the String representation of this object. 244 */ 245 public String toString() { 246 return getBaseType() + parameters.toString(); 247 } 248 249 /** 250 * Return a String representation of this object 251 * without the parameter list. 252 */ 253 public String getBaseType() { 254 return primaryType + "/" + subType; 255 } 256 | 207 208 /** 209 * Retrieve a copy of this object's parameter list. 210 */ 211 public MimeTypeParameterList getParameters() { 212 return (MimeTypeParameterList)parameters.clone(); 213 } 214 215 /** 216 * Retrieve the value associated with the given name, or null if there 217 * is no current association. 218 */ 219 public String getParameter(String name) { 220 return parameters.get(name); 221 } 222 223 /** 224 * Set the value to be associated with the given name, replacing 225 * any previous association. 226 * 227 * @throws IllegalArgumentException if parameter or value is illegal 228 */ 229 public void setParameter(String name, String value) { 230 parameters.set(name, value); 231 } 232 233 /** 234 * Remove any value associated with the given name. 235 * 236 * @throws IllegalArgumentException if parameter may not be deleted 237 */ 238 public void removeParameter(String name) { 239 parameters.remove(name); 240 } 241 242 /** 243 * Return the String representation of this object. 244 */ 245 public String toString() { 246 return getBaseType() + parameters.toString(); 247 } 248 249 /** 250 * Return a String representation of this object 251 * without the parameter list. 252 */ 253 public String getBaseType() { 254 return primaryType + "/" + subType; 255 } 256 |