public final class Conditionals extends Object
| Conditional | Can be combined with | Unspecified |
|---|---|---|
| If-Match | If-Unmodified-Since | If-None-Match, If-Modified-Since |
| If-None-Match | If-Modified-Since | If-Match, If-Unmodified-Since |
| If-Unmodified-Since | If-Match | If-None-Match, If-Modified-Since |
| If-Modified-Since | If-None-Match | If-Match, If-Unmodified-Since |
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Function<String,Tag> |
tagFunction |
| Constructor and Description |
|---|
Conditionals() |
Conditionals(List<Tag> match,
List<Tag> noneMatch,
org.joda.time.DateTime modifiedSince,
org.joda.time.DateTime unModifiedSince) |
| Modifier and Type | Method and Description |
|---|---|
Conditionals |
addIfMatch(Tag tag)
Adds tags to the If-Match header.
|
Conditionals |
addIfNoneMatch(Tag tag)
Adds tags to the If-None-Match header.
|
List<Tag> |
getMatch() |
org.joda.time.DateTime |
getModifiedSince() |
List<Tag> |
getNoneMatch() |
org.joda.time.DateTime |
getUnModifiedSince() |
Conditionals |
ifModifiedSince(org.joda.time.DateTime time)
You should use the server's time here.
|
Conditionals |
ifUnModifiedSince(org.joda.time.DateTime time)
You should use the server's time here.
|
boolean |
isUnconditional() |
Headers |
toHeaders()
Converts the Conditionals into real headers.
|
static Conditionals |
valueOf(Headers headers) |
public Conditionals addIfMatch(Tag tag)
tag - the tag to add, may be null. This means the same as adding Tag.ALLIllegalArgumentException - if ALL is supplied more than once, or you add a null tag more than once.public Conditionals addIfNoneMatch(Tag tag)
tag - the tag to add, may be null. This means the same as adding Tag.ALLIllegalArgumentException - if ALL is supplied more than once, or you add a null tag more than once.public Conditionals ifModifiedSince(org.joda.time.DateTime time)
HTTPResponse response = .... HTTPRequest request = createRequest(); request = request.conditionals(new Conditionals().ifModifiedSince(response.getLastModified());
time - the time to check.public Conditionals ifUnModifiedSince(org.joda.time.DateTime time)
HTTPResponse response = .... HTTPRequest request = createRequest(); request = request.conditionals(new Conditionals().ifUnModifiedSince(response.getLastModified());
time - the time to check.public org.joda.time.DateTime getModifiedSince()
public org.joda.time.DateTime getUnModifiedSince()
public boolean isUnconditional()
true if the Conditionals represents a unconditional request.public Headers toHeaders()
public static Conditionals valueOf(Headers headers)
Copyright © 2008-2013. All Rights Reserved.