Package javax.ws.rs.core
Class EntityTag
java.lang.Object
javax.ws.rs.core.EntityTag
An abstraction for the value of a HTTP Entity Tag, used as the value
of an ETag response header.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares obj to this tag to see if they are the same considering weakness and value.getValue()
Get the value of an EntityTagint
hashCode()
Generate hashCode based on value and weakness.boolean
isWeak()
Check the strength of an EntityTagtoString()
Convert the entity tag to a string suitable for use as the value of the corresponding HTTP header.static EntityTag
Creates a new instance of EntityTag by parsing the supplied string.
-
Field Details
-
value
-
weak
private boolean weak -
delegate
-
-
Constructor Details
-
EntityTag
Creates a new instance of a strong EntityTag.- Parameters:
value
- the value of the tag, quotes not included.- Throws:
IllegalArgumentException
- if value is null
-
EntityTag
Creates a new instance of an EntityTag- Parameters:
value
- the value of the tag, quotes not included.weak
- true if this represents a weak tag, false otherwise- Throws:
IllegalArgumentException
- if value is null
-
-
Method Details
-
valueOf
Creates a new instance of EntityTag by parsing the supplied string.- Parameters:
value
- the entity tag string- Returns:
- the newly created EntityTag
- Throws:
IllegalArgumentException
- if the supplied string cannot be parsed or is null
-
isWeak
public boolean isWeak()Check the strength of an EntityTag- Returns:
- true if this represents a weak tag, false otherwise
-
getValue
Get the value of an EntityTag- Returns:
- the value of the tag
-
equals
Compares obj to this tag to see if they are the same considering weakness and value. -
hashCode
public int hashCode()Generate hashCode based on value and weakness. -
toString
Convert the entity tag to a string suitable for use as the value of the corresponding HTTP header.
-