org.restlet.data
Class Conditions

java.lang.Object
  extended by org.restlet.data.Conditions

public final class Conditions
extends java.lang.Object

Set of conditions applying to a request. This is equivalent to the HTTP conditional headers.

Author:
Jerome Louvel
See Also:
If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since

Constructor Summary
Conditions()
          Constructor.
 
Method Summary
 java.util.List<Tag> getMatch()
          Returns the modifiable list of tags for the "if-match" condition.
 java.util.Date getModifiedSince()
          Returns the "if-modified-since" condition.
 java.util.List<Tag> getNoneMatch()
          Returns the modifiable list of tags for the "if-none-match" condition.
 Status getStatus(Method method, Representation representation)
          Returns the conditional status of a variant using a given method.
 java.util.Date getUnmodifiedSince()
          Returns the "if-unmodified-since" condition.
 boolean hasSome()
          Indicates if there are some conditions set.
 void setMatch(java.util.List<Tag> tags)
          Sets the "if-match" condition.
 void setModifiedSince(java.util.Date date)
          Sets the "if-modified-since" condition.
 void setNoneMatch(java.util.List<Tag> tags)
          Sets the "if-none-match" condition.
 void setUnmodifiedSince(java.util.Date date)
          Sets the "if-unmodified-since" condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Conditions

public Conditions()
Constructor.

Method Detail

getMatch

public java.util.List<Tag> getMatch()
Returns the modifiable list of tags for the "if-match" condition. Creates a new instance if no one has been set.

Returns:
The "if-match" condition.

getModifiedSince

public java.util.Date getModifiedSince()
Returns the "if-modified-since" condition.

Returns:
The "if-modified-since" condition.

getNoneMatch

public java.util.List<Tag> getNoneMatch()
Returns the modifiable list of tags for the "if-none-match" condition. Creates a new instance if no one has been set.

Returns:
The "if-none-match" condition.

getStatus

public Status getStatus(Method method,
                        Representation representation)
Returns the conditional status of a variant using a given method.

Parameters:
method - The request method.
representation - The representation whose entity tag or date of modification will be tested
Returns:
Null if the requested method can be performed, the status of the response otherwise.

getUnmodifiedSince

public java.util.Date getUnmodifiedSince()
Returns the "if-unmodified-since" condition.

Returns:
The "if-unmodified-since" condition.

hasSome

public boolean hasSome()
Indicates if there are some conditions set.

Returns:
True if there are some conditions set.

setMatch

public void setMatch(java.util.List<Tag> tags)
Sets the "if-match" condition.

Parameters:
tags - The "if-match" condition.

setModifiedSince

public void setModifiedSince(java.util.Date date)
Sets the "if-modified-since" condition.

Parameters:
date - The "if-modified-since" condition.

setNoneMatch

public void setNoneMatch(java.util.List<Tag> tags)
Sets the "if-none-match" condition.

Parameters:
tags - The "if-none-match" condition.

setUnmodifiedSince

public void setUnmodifiedSince(java.util.Date date)
Sets the "if-unmodified-since" condition.

Parameters:
date - The "if-unmodified-since" condition.


Copyright © 2005-2008 Noelios Technologies.