Package org.apache.juneau.http.header
Class BasicUriHeader
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.BasicUriHeader
- All Implemented Interfaces:
- Serializable,- Cloneable,- Header,- NameValuePair
- Direct Known Subclasses:
- ContentLocation,- Location,- Referer
Category of headers that consist of a single URL value.
 
Example
Location: http://www.w3.org/pub/WWW/People.html
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBasicUriHeader(String name, String value) Constructor.BasicUriHeader(String name, URI value) Constructor.BasicUriHeader(String name, Supplier<URI> value) Constructor with delayed value.
- 
Method SummaryModifier and TypeMethodDescriptionasUri()getValue()static BasicUriHeaderStatic creator.static BasicUriHeaderStatic creator.static BasicUriHeaderStatic creator with delayed value.Return the value if present, otherwise returnother .toUri()Methods inherited from class org.apache.juneau.http.header.BasicHeaderassertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
- 
Constructor Details- 
BasicUriHeaderConstructor.- Parameters:
- name- The header name.
- value- The header value.
 Must be parsable by- URI.create(String).
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
BasicUriHeaderConstructor.- Parameters:
- name- The header name.
- value- The header value.
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
BasicUriHeaderConstructor with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The header name.
- value- The supplier of the header value.
 Can be- null .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- name- The header name.
- value- The header value.
 Must be parsable by- URI.create(String).
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofStatic creator.- Parameters:
- name- The header name.
- value- The header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
ofStatic creator with delayed value.Header value is re-evaluated on each call to getValue().- Parameters:
- name- The header name.
- value- The supplier of the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
- Throws:
- IllegalArgumentException- If name is- null or empty.
 
- 
getValue- Specified by:
- getValuein interface- NameValuePair
- Overrides:
- getValuein class- BasicHeader
 
- 
asUri
- 
toUri
- 
orElseReturn the value if present, otherwise returnother .This is a shortened form for calling asUri().orElse( .other )- Parameters:
- other- The value to be returned if there is no value present, can be- null .
- Returns:
- The value, if present, otherwise other .
 
 
-