Class ResourceAdditionalProperties<Type extends IridaRepresentationModel>
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.web.assembler.resource.ResourceAdditionalProperties<Type>
-
- Type Parameters:
Type
- The type of class being embedded.
public class ResourceAdditionalProperties<Type extends IridaRepresentationModel> extends java.lang.Object
Class to be used when returning additional properties about a model object via the REST API. This class will embed a model class and add a map of freeform properties. When serializing to JSON it will be transparent that these properties weren't on the model object to begin with. Example of this being used is adding the number of sequence files to a sample.
-
-
Constructor Summary
Constructors Constructor Description ResourceAdditionalProperties(Type resource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProperty(java.lang.String key, java.lang.Object value)
Add a property to the mapjava.util.Map<java.lang.String,java.lang.Object>
getAdditionalProperties()
Get the added propertiesType
getResource()
Get the embedded resourcevoid
setAdditionalProperties(java.util.Map<java.lang.String,java.lang.Object> additionalProperties)
Set the map of additional propertiesvoid
setResource(Type resource)
Set the resource of this object
-
-
-
Constructor Detail
-
ResourceAdditionalProperties
public ResourceAdditionalProperties(Type resource)
-
-
Method Detail
-
getAdditionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalProperties()
Get the added properties- Returns:
- A
Map<String,Object>
-
setAdditionalProperties
public void setAdditionalProperties(java.util.Map<java.lang.String,java.lang.Object> additionalProperties)
Set the map of additional properties- Parameters:
additionalProperties
- AMap<String,Object>
of properties to set
-
addProperty
public void addProperty(java.lang.String key, java.lang.Object value)
Add a property to the map- Parameters:
key
- The key to setvalue
- the value to set
-
getResource
public Type getResource()
Get the embedded resource- Returns:
- The resource of Type
-
setResource
public void setResource(Type resource)
Set the resource of this object- Parameters:
resource
- The resource to set
-
-