/** * Returns a parsed <code>Warning</code> header. * * @param value The <code>Warning</code> header string. * @return The parsed <code>Warning</code> header, or <jk>null</jk> if the string was null. */ public static Warning forString(String value) { if (value == null) return null; return new Warning(value); }
/** * Returns a hash based on this instance's <code>media-type</code>. * * @return A hash based on this instance's <code>media-type</code>. */ @Override /* Object */ public int hashCode() { return mediaType.hashCode(); }
/** * Returns a parsed <code>Last-Modified</code> header. * * @param value The <code>Last-Modified</code> header string. * @return The parsed <code>Last-Modified</code> header, or <jk>null</jk> if the string was null. */ public static LastModified forString(String value) { if (value == null) return null; return new LastModified(value); }
/** * Create a new {@link StreamResource} using values in this builder. * * @return A new immutable {@link StreamResource} object. * @throws IOException */ public StreamResource build() throws IOException { return new StreamResource(this); } }
/** * Create a new {@link ReaderResource} using values in this builder. * * @return A new immutable {@link ReaderResource} object. * @throws IOException */ public ReaderResource build() throws IOException { return new ReaderResource(this); } }
@Override /* Object */ public String toString() { return asString(); } }
/** * Returns a parsed <code>Content-Location</code> header. * * @param value The <code>Content-Location</code> header string. * @return The parsed <code>Content-Location</code> header, or <jk>null</jk> if the string was null. */ public static ContentLocation forString(String value) { if (value == null) return null; return new ContentLocation(value); }
/** * Returns a parsed <code>Host</code> header. * * @param value The <code>Host</code> header string. * @return The parsed <code>Host</code> header, or <jk>null</jk> if the string was null. */ public static Host forString(String value) { if (value == null) return null; return new Host(value); }
/** * Returns a parsed <code>Proxy-Authorization</code> header. * * @param value The <code>Proxy-Authorization</code> header string. * @return The parsed <code>Proxy-Authorization</code> header, or <jk>null</jk> if the string was null. */ public static ProxyAuthorization forString(String value) { if (value == null) return null; return new ProxyAuthorization(value); }
/** * Returns a parsed <code>Cache-Control</code> header. * * @param value The <code>Cache-Control</code> header string. * @return The parsed <code>Cache-Control</code> header, or <jk>null</jk> if the string was null. */ public static CacheControl forString(String value) { if (value == null) return null; return new CacheControl(value); }
/** * Returns a parsed <code>ETag</code> header. * * @param value The <code>ETag</code> header string. * @return The parsed <code>ETag</code> header, or <jk>null</jk> if the string was null. */ public static ETag forString(String value) { if (value == null) return null; return new ETag(value); }
/** * Returns a parsed <code>Range</code> header. * * @param value The <code>Range</code> header string. * @return The parsed <code>Range</code> header, or <jk>null</jk> if the string was null. */ public static Range forString(String value) { if (value == null) return null; return new Range(value); }
/** * Returns a parsed <code>Authorization</code> header. * * @param value The <code>Authorization</code> header string. * @return The parsed <code>Authorization</code> header, or <jk>null</jk> if the string was null. */ public static Authorization forString(String value) { if (value == null) return null; return new Authorization(value); }
/** * Returns a parsed <code>Accept-Ranges</code> header. * * @param value The <code>Accept-Ranges</code> header string. * @return The parsed <code>Accept-Ranges</code> header, or <jk>null</jk> if the string was null. */ public static AcceptRanges forString(String value) { if (value == null) return null; return new AcceptRanges(value); }
/** * Returns a parsed <code>Proxy-Authenticate</code> header. * * @param value The <code>Proxy-Authenticate</code> header string. * @return The parsed <code>Proxy-Authenticate</code> header, or <jk>null</jk> if the string was null. */ public static ProxyAuthenticate forString(String value) { if (value == null) return null; return new ProxyAuthenticate(value); }
/** * Returns a parsed <code>Referer</code> header. * * @param value The <code>Referer</code> header string. * @return The parsed <code>Referer</code> header, or <jk>null</jk> if the string was null. */ public static Referer forString(String value) { if (value == null) return null; return new Referer(value); }
/** * Returns a parsed <code>Content-Range</code> header. * * @param value The <code>Content-Range</code> header string. * @return The parsed <code>Content-Range</code> header, or <jk>null</jk> if the string was null. */ public static ContentRange forString(String value) { if (value == null) return null; return new ContentRange(value); }
@Override public String toString() { return (isWeak ? "W/" : "") + (isAny() ? "*" : ('"' + value + '"')); } }
/** * Returns a parsed <code>Content-Encoding</code> header. * * @param value The <code>Content-Encoding</code> header string. * @return The parsed <code>Content-Encoding</code> header, or <jk>null</jk> if the string was null. */ public static ContentEncoding forString(String value) { if (value == null) return null; return new ContentEncoding(value); }
/** * Creates a new instance of a {@link Builder} for this class. * * @return A new instance of a {@link Builder}. */ public static Builder create() { return new Builder(); }