/** * Get the string encoded version of this object * @since v1.0 */ public String encode() { String encoded_string = ATTRIBUTE_FIELD; if (attribute != null) encoded_string += attribute.encode(); return encoded_string + Separators.NEWLINE; }
@Override public int hashCode() { return this.encode().toLowerCase().hashCode(); } }
/** * Get the encoded representation of this namevalue object. Added * doublequote for encoding doublequoted values. * * Bug: RFC3261 stipulates that an opaque parameter in authenticate header * has to be: * opaque = "opaque" EQUAL quoted-string * so returning just the name is not acceptable. (e.g. LinkSys phones * are picky about this) * * @since 1.0 * @return an encoded name value (eg. name=value) string. */ public String encode() { return encode(new StringBuilder()).toString(); }