- java.lang.Object
-
- javax.ws.rs.core.EntityTag
-
public class EntityTag extends Object
An abstraction for the value of a HTTP Entity Tag, used as the value of an ETag response header.- Since:
- 1.0
- Author:
- Paul Sandoz, Marc Hadley
- See Also:
- HTTP/1.1 section 3.11
-
-
Constructor Summary
Constructors Constructor and Description EntityTag(String value)
Creates a new instance of a strongEntityTag
.EntityTag(String value, boolean weak)
Creates a new instance of anEntityTag
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
equals(Object obj)
Comparesobj
to this tag to see if they are the same considering weakness and value.String
getValue()
Get the value of anEntityTag
.int
hashCode()
Generate hashCode based on value and weakness.boolean
isWeak()
Check the strength of anEntityTag
.String
toString()
Convert the entity tag to a string suitable for use as the value of the corresponding HTTP header.static EntityTag
valueOf(String value)
Creates a new instance ofEntityTag
by parsing the supplied string.
-
-
-
Constructor Detail
-
EntityTag
public EntityTag(String value)
Creates a new instance of a strongEntityTag
.- Parameters:
value
- the value of the tag, quotes not included.- Throws:
IllegalArgumentException
- if value isnull
.
-
EntityTag
public EntityTag(String value, boolean weak)
Creates a new instance of anEntityTag
.- Parameters:
value
- the value of the tag, quotes not included.weak
-true
if this represents a weak tag,false
otherwise.- Throws:
IllegalArgumentException
- if value isnull
.
-
-
Method Detail
-
valueOf
public static EntityTag valueOf(String value)
Creates a new instance ofEntityTag
by parsing the supplied string.- Parameters:
value
- the entity tag string.- Returns:
- the newly created entity tag.
- Throws:
IllegalArgumentException
- if the supplied string cannot be parsed or isnull
.
-
isWeak
public boolean isWeak()
Check the strength of anEntityTag
.- Returns:
true
if this represents a weak tag,false
otherwise.
-
getValue
public String getValue()
Get the value of anEntityTag
.- Returns:
- the value of the tag.
-
equals
public boolean equals(Object obj)
Comparesobj
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.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 17:22:11 Cette version de la page est en cache (à la date du 21/08/2025 17:22:11) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/ws/rs/core/entitytag.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.