public class EntityTag
extends java.lang.Object
| Constructor and Description |
|---|
EntityTag(java.lang.String value)
Creates a new instance of a strong EntityTag.
|
EntityTag(java.lang.String value,
boolean weak)
Creates a new instance of an EntityTag
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares obj to this tag to see if they are the same considering weakness and
value.
|
java.lang.String |
getValue()
Get the value of an EntityTag
|
int |
hashCode()
Generate hashCode based on value and weakness.
|
boolean |
isWeak()
Check the strength of an EntityTag
|
java.lang.String |
toString()
Convert the entity tag to a string suitable for use as the value of the
corresponding HTTP header.
|
static EntityTag |
valueOf(java.lang.String value)
Creates a new instance of EntityTag by parsing the supplied string.
|
public EntityTag(java.lang.String value)
value - the value of the tag, quotes not included.java.lang.IllegalArgumentException - if value is nullpublic EntityTag(java.lang.String value,
boolean weak)
value - the value of the tag, quotes not included.weak - true if this represents a weak tag, false otherwisejava.lang.IllegalArgumentException - if value is nullpublic static EntityTag valueOf(java.lang.String value) throws java.lang.IllegalArgumentException
value - the entity tag stringjava.lang.IllegalArgumentException - if the supplied string cannot be parsed
or is nullpublic boolean isWeak()
public java.lang.String getValue()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare topublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2016 Oracle Corporation. All Rights Reserved.