org.restlet.representation

## Class RepresentationInfo

- java.lang.Object
- - org.restlet.representation.Variant
  - - org.restlet.representation.RepresentationInfo

Direct Known Subclasses:
  Representation

    public class RepresentationInfo
    extends Variant

Information about a representation. Those metadata don't belong to the parent `Variant` class, however they are important for conditional method processing. The advantage over the complete `Representation` class is that it is much lighter to create.

Author:
  Jerome Louvel
See Also:
  Source dissertation

### Constructor Summary

Constructors
Constructor and Description
`RepresentationInfo()` Default constructor.
`RepresentationInfo(MediaType mediaType)` Constructor.
`RepresentationInfo(MediaType mediaType, java.util.Date modificationDate)` Constructor.
`RepresentationInfo(MediaType mediaType, java.util.Date modificationDate, Tag tag)` Constructor.
`RepresentationInfo(MediaType mediaType, Tag tag)` Constructor.
`RepresentationInfo(Variant variant, java.util.Date modificationDate)` Constructor from a variant.
`RepresentationInfo(Variant variant, java.util.Date modificationDate, Tag tag)` Constructor from a variant.
`RepresentationInfo(Variant variant, Tag tag)` Constructor from a variant.

### Method Summary

Methods
`java.util.Date` `getModificationDate()` Returns the last date when this representation was modified.
`Tag` `getTag()` Returns the tag. Note that when used with HTTP connectors, this property maps to the "ETag" header.
`void` `setModificationDate(java.util.Date modificationDate)` Sets the last date when this representation was modified.
`void` `setTag(Tag tag)` Sets the tag. Note that when used with HTTP connectors, this property maps to the "ETag" header.

### Methods inherited from class org.restlet.representation.Variant

`createClientInfo, equals, getCharacterSet, getEncodings, getIdentifier, getLanguages, getLocationRef, getMediaType, includes, isCompatible, setCharacterSet, setEncodings, setIdentifier, setIdentifier, setLanguages, setLocationRef, setLocationRef, setMediaType, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### RepresentationInfo

    public RepresentationInfo()

Default constructor.

#### RepresentationInfo

    public RepresentationInfo(MediaType mediaType)

Constructor.

Parameters:
  `mediaType` - The media type.

#### RepresentationInfo

    public RepresentationInfo(MediaType mediaType,
                      java.util.Date modificationDate)

Constructor.

Parameters:
  `mediaType` - The media type.
  `modificationDate` - The modification date.

#### RepresentationInfo

    public RepresentationInfo(MediaType mediaType,
                      java.util.Date modificationDate,
                      Tag tag)

Constructor.

Parameters:
  `mediaType` - The media type.
  `modificationDate` - The modification date.
  `tag` - The tag.

#### RepresentationInfo

    public RepresentationInfo(MediaType mediaType,
                      Tag tag)

Constructor.

Parameters:
  `mediaType` - The media type.
  `tag` - The tag.

#### RepresentationInfo

    public RepresentationInfo(Variant variant,
                      java.util.Date modificationDate)

Constructor from a variant.

Parameters:
  `variant` - The variant to copy.
  `modificationDate` - The modification date.

#### RepresentationInfo

    public RepresentationInfo(Variant variant,
                      java.util.Date modificationDate,
                      Tag tag)

Constructor from a variant.

Parameters:
  `variant` - The variant to copy.
  `modificationDate` - The modification date.
  `tag` - The tag.

#### RepresentationInfo

    public RepresentationInfo(Variant variant,
                      Tag tag)

Constructor from a variant.

Parameters:
  `variant` - The variant to copy.
  `tag` - The tag.

### Method Detail

#### getModificationDate

    public java.util.Date getModificationDate()

Returns the last date when this representation was modified. If this information is not known, returns null.
Note that when used with HTTP connectors, this property maps to the "Last-Modified" header.

Returns:
  The modification date.

#### getTag

    public Tag getTag()

Returns the tag.
Note that when used with HTTP connectors, this property maps to the "ETag" header.

Returns:
  The tag.

#### setModificationDate

    public void setModificationDate(java.util.Date modificationDate)

Sets the last date when this representation was modified. If this information is not known, pass null.
Note that when used with HTTP connectors, this property maps to the "Last-Modified" header.

Parameters:
  `modificationDate` - The modification date.

#### setTag

    public void setTag(Tag tag)

Sets the tag.
Note that when used with HTTP connectors, this property maps to the "ETag" header.

Parameters:
  `tag` - The tag.