Package org.restlet.data
Class Tag
java.lang.Object
org.restlet.data.Tag
Validation tag equivalent to an HTTP entity tag (E-Tag). "A strong entity tag
may be shared by two entities of a resource only if they are equivalent by
octet equality.
A weak entity tag may be shared by two entities of a resource only if the entities are equivalent and could be substituted for each other with no significant change in semantics."
A weak entity tag may be shared by two entities of a resource only if the entities are equivalent and could be substituted for each other with no significant change in semantics."
- Author:
- Jerome Louvel
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates if both tags are equal.booleanIndicates if both tags are equal.format()Returns tag formatted as an HTTP tag string.getName()Returns the name, corresponding to an HTTP opaque tag value.inthashCode()booleanisWeak()Indicates if the tag is weak.static TagParses a tag formatted as defined by the HTTP standard.toString()Returns the name.
-
Field Details
-
ALL
Tag matching any other tag, used in call's condition data.
-
-
Constructor Details
-
Tag
public Tag()Default constructor. The opaque tag is set to null and the weakness indicator is set to true. -
Tag
Constructor of weak tags.- Parameters:
opaqueTag- The tag value.
-
Tag
Constructor.- Parameters:
opaqueTag- The tag value.weak- The weakness indicator.
-
-
Method Details
-
parse
Parses a tag formatted as defined by the HTTP standard.- Parameters:
httpTag- The HTTP tag string; if it starts with 'W/' the tag will be marked as weak and the data following the 'W/' used as the tag; otherwise it should be surrounded with quotes (e.g., "sometag").- Returns:
- A new tag instance.
- See Also:
-
equals
Indicates if both tags are equal. -
equals
Indicates if both tags are equal.- Parameters:
object- The object to compare to.checkWeakness- The equality test takes care or not of the weakness.- Returns:
- True if both tags are equal.
-
format
Returns tag formatted as an HTTP tag string.- Returns:
- The formatted HTTP tag string.
- See Also:
-
getName
Returns the name, corresponding to an HTTP opaque tag value.- Returns:
- The name, corresponding to an HTTP opaque tag value.
-
hashCode
public int hashCode() -
isWeak
public boolean isWeak()Indicates if the tag is weak.- Returns:
- True if the tag is weak, false if the tag is strong.
-
toString
Returns the name.
-