示例#1
0
 /**
  * Gets metadata for this request cycle using the given key.
  *
  * @param <T> The type of the metadata
  * @param key The key for the data
  * @return The metadata or null if no metadata was found for the given key
  * @see MetaDataKey
  */
 public <T> T getMetaData(final MetaDataKey<T> key) {
   return key.get(metaData);
 }
示例#2
0
 /**
  * Sets the metadata for this request cycle using the given key. If the metadata object is not of
  * the correct type for the metadata key, an IllegalArgumentException will be thrown. For
  * information on creating MetaDataKeys, see {@link MetaDataKey}.
  *
  * @param key The singleton key for the metadata
  * @param object The metadata object
  * @param <T>
  * @throws IllegalArgumentException
  * @see MetaDataKey
  */
 public <T> void setMetaData(final MetaDataKey<T> key, final T object) {
   metaData = key.set(metaData, object);
 }