org.apache.abdera.util
Class EntityTag

java.lang.Object
  extended by org.apache.abdera.util.EntityTag
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EntityTag>

public class EntityTag
extends Object
implements Cloneable, Serializable, Comparable<EntityTag>

Implements an EntityTag.

See Also:
Serialized Form

Field Summary
static EntityTag WILD
           
 
Constructor Summary
EntityTag(String tag)
           
EntityTag(String tag, boolean weak)
           
 
Method Summary
protected  EntityTag clone()
           
 int compareTo(EntityTag o)
           
 boolean equals(Object obj)
           
static EntityTag generate(String... material)
          Utility method for generating ETags.
 String getTag()
           
 int hashCode()
           
 boolean isWeak()
           
 boolean isWild()
           
static boolean matches(EntityTag tag1, EntityTag tag2)
           
static boolean matches(EntityTag etag, String... material)
          Checks that the passed in ETag matches the ETag generated by the generate method
static boolean matches(EntityTag tag1, String tag2)
           
static boolean matches(String tag1, String tag2)
           
static boolean matchesAny(EntityTag tag1, EntityTag[] tags)
           
static boolean matchesAny(EntityTag tag1, EntityTag[] tags, boolean weak)
           
static boolean matchesAny(EntityTag tag1, String tags)
           
static boolean matchesAny(EntityTag tag1, String tags, boolean weak)
           
static boolean matchesAny(String tag1, String tags)
           
static boolean matchesAny(String tag1, String tags, boolean weak)
           
static EntityTag parse(String entity_tag)
           
static EntityTag[] parseTags(String entity_tags)
           
 String toString()
           
static String toString(EntityTag... tags)
           
static String toString(String... tags)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

WILD

public static final EntityTag WILD
Constructor Detail

EntityTag

public EntityTag(String tag)

EntityTag

public EntityTag(String tag,
                 boolean weak)
Method Detail

parse

public static EntityTag parse(String entity_tag)

parseTags

public static EntityTag[] parseTags(String entity_tags)

matchesAny

public static boolean matchesAny(EntityTag tag1,
                                 String tags)

matchesAny

public static boolean matchesAny(EntityTag tag1,
                                 String tags,
                                 boolean weak)

matchesAny

public static boolean matchesAny(String tag1,
                                 String tags)

matchesAny

public static boolean matchesAny(String tag1,
                                 String tags,
                                 boolean weak)

matchesAny

public static boolean matchesAny(EntityTag tag1,
                                 EntityTag[] tags)

matchesAny

public static boolean matchesAny(EntityTag tag1,
                                 EntityTag[] tags,
                                 boolean weak)

matches

public static boolean matches(EntityTag tag1,
                              EntityTag tag2)

matches

public static boolean matches(String tag1,
                              String tag2)

matches

public static boolean matches(EntityTag tag1,
                              String tag2)

isWild

public boolean isWild()

getTag

public String getTag()

isWeak

public boolean isWeak()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

clone

protected EntityTag clone()
Overrides:
clone in class Object

generate

public static EntityTag generate(String... material)
Utility method for generating ETags. Works by concatenating the UTF-8 bytes of the provided strings then generating an MD5 hash of the result.


matches

public static boolean matches(EntityTag etag,
                              String... material)
Checks that the passed in ETag matches the ETag generated by the generate method


toString

public static String toString(EntityTag... tags)

toString

public static String toString(String... tags)

compareTo

public int compareTo(EntityTag o)
Specified by:
compareTo in interface Comparable<EntityTag>


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.