org.restlet.resource
Class Variant

java.lang.Object
  extended by org.restlet.resource.Variant
Direct Known Subclasses:
Representation

public class Variant
extends java.lang.Object

Descriptor for available representations of a resource. It contains all the important metadata about a representation but is not able to actually serve the representation's content itself.

For this, you need to use the Representation subclass.

Author:
Jerome Louvel

Field Summary
static long UNKNOWN_SIZE
          Deprecated. Use the Representation.UNKNOWN_SIZE constant instead.
 
Constructor Summary
Variant()
          Default constructor.
Variant(MediaType mediaType)
          Constructor.
 
Method Summary
 CharacterSet getCharacterSet()
          Returns the character set or null if not applicable.
 java.util.List<Encoding> getEncodings()
          Returns the modifiable list of encodings applied to the entity-body.
 java.util.Date getExpirationDate()
          Deprecated. Use the Representation.getExpirationDate() method instead.
 Reference getIdentifier()
          Returns an optional identifier.
 java.util.List<Language> getLanguages()
          Returns the modifiable list of languages.
 MediaType getMediaType()
          Returns the media type.
 java.util.Date getModificationDate()
          Deprecated. Use the Representation.getModificationDate() method instead.
 long getSize()
          Deprecated. Use the Representation.getSize() method instead.
 Tag getTag()
          Deprecated. Use the Representation.getTag() method instead.
 void setCharacterSet(CharacterSet characterSet)
          Sets the character set or null if not applicable.
 void setEncodings(java.util.List<Encoding> encodings)
          Sets the list of encodings applied to the entity-body.
 void setExpirationDate(java.util.Date expirationDate)
          Deprecated. Use the Representation.setExpirationDate(Date) method instead.
 void setIdentifier(Reference identifier)
          Sets the optional identifier.
 void setIdentifier(java.lang.String identifierUri)
          Sets the identifier from a URI string.
 void setLanguages(java.util.List<Language> languages)
          Sets the list of languages.
 void setMediaType(MediaType mediaType)
          Sets the media type.
 void setModificationDate(java.util.Date modificationDate)
          Deprecated. Use the Representation.setModificationDate(Date) method instead.
 void setSize(long expectedSize)
          Deprecated. Use the Representation.setSize(long) method instead.
 void setTag(Tag tag)
          Deprecated. Use the Representation.setTag(Tag) method instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN_SIZE

@Deprecated
public static final long UNKNOWN_SIZE
Deprecated. Use the Representation.UNKNOWN_SIZE constant instead.
Indicates that the size of the representation can't be known in advance.

See Also:
Constant Field Values
Constructor Detail

Variant

public Variant()
Default constructor.


Variant

public Variant(MediaType mediaType)
Constructor.

Parameters:
mediaType - The media type.
Method Detail

getCharacterSet

public CharacterSet getCharacterSet()
Returns the character set or null if not applicable.

Returns:
The character set or null if not applicable.

getEncodings

public java.util.List<Encoding> getEncodings()
Returns the modifiable list of encodings applied to the entity-body. Creates a new instance if no one has been set. An "IllegalArgumentException" exception is thrown when adding a null encoding to this list.

Returns:
The list of encodings applied to the entity-body.

getExpirationDate

@Deprecated
public java.util.Date getExpirationDate()
Deprecated. Use the Representation.getExpirationDate() method instead.

Returns the future date when this representation expire. If this information is not known, returns null.

Returns:
The expiration date.

getIdentifier

public Reference getIdentifier()
Returns an optional identifier. This is useful when the representation is accessible from a location separate from the representation's resource URI, for example when content negotiation occurs.

Returns:
The identifier.

getLanguages

public java.util.List<Language> getLanguages()
Returns the modifiable list of languages. Creates a new instance if no one has been set. An "IllegalArgumentException" exception is thrown when adding a null language to this list.

Returns:
The list of languages.

getMediaType

public MediaType getMediaType()
Returns the media type.

Returns:
The media type.

getModificationDate

@Deprecated
public java.util.Date getModificationDate()
Deprecated. Use the Representation.getModificationDate() method instead.

Returns the last date when this representation was modified. If this information is not known, returns null.

Returns:
The modification date.

getSize

@Deprecated
public long getSize()
Deprecated. Use the Representation.getSize() method instead.

Returns the size in bytes if known, UNKNOWN_SIZE (-1) otherwise.

Returns:
The size in bytes if known, UNKNOWN_SIZE (-1) otherwise.

getTag

@Deprecated
public Tag getTag()
Deprecated. Use the Representation.getTag() method instead.

Returns the tag.

Returns:
The tag.

setCharacterSet

public void setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable.

Parameters:
characterSet - The character set or null if not applicable.

setEncodings

public void setEncodings(java.util.List<Encoding> encodings)
Sets the list of encodings applied to the entity-body.

Parameters:
encodings - The list of encodings applied to the entity-body.

setExpirationDate

@Deprecated
public void setExpirationDate(java.util.Date expirationDate)
Deprecated. Use the Representation.setExpirationDate(Date) method instead.

Sets the future date when this representation expire. If this information is not known, pass null.

Parameters:
expirationDate - The expiration date.

setIdentifier

public void setIdentifier(Reference identifier)
Sets the optional identifier. This is useful when the representation is accessible from a location separate from the representation's resource URI, for example when content negotiation occurs.

Parameters:
identifier - The identifier.

setIdentifier

public void setIdentifier(java.lang.String identifierUri)
Sets the identifier from a URI string.

Parameters:
identifierUri - The identifier to parse.

setLanguages

public void setLanguages(java.util.List<Language> languages)
Sets the list of languages.

Parameters:
languages - The list of languages.

setMediaType

public void setMediaType(MediaType mediaType)
Sets the media type.

Parameters:
mediaType - The media type.

setModificationDate

@Deprecated
public void setModificationDate(java.util.Date modificationDate)
Deprecated. Use the Representation.setModificationDate(Date) method instead.

Sets the last date when this representation was modified. If this information is not known, pass null.

Parameters:
modificationDate - The modification date.

setSize

@Deprecated
public void setSize(long expectedSize)
Deprecated. Use the Representation.setSize(long) method instead.

Sets the expected size in bytes if known, -1 otherwise.

Parameters:
expectedSize - The expected size in bytes if known, -1 otherwise.

setTag

@Deprecated
public void setTag(Tag tag)
Deprecated. Use the Representation.setTag(Tag) method instead.

Sets the tag.

Parameters:
tag - The tag.


Copyright © 2005-2008 Noelios Technologies.