Package org.jdesktop.http
Class Header
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.http.NameValuePair
org.jdesktop.http.Header
- All Implemented Interfaces:
Cloneable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA representation of an Element within a Header. -
Constructor Summary
ConstructorsConstructorDescriptionHeader()Creates a new Header with a null name and value, and no elements.Creates a new Header with the given name and value, and no elements.Header(String name, String value, Header.Element... elements)Creates a new Header with the given name, value, and elements. -
Method Summary
Modifier and TypeMethodDescriptionReturns an array of Elements for this Header.voidsetElements(Header.Element... elements)Sets the elements.toString()Methods inherited from class org.jdesktop.http.NameValuePair
clone, getName, getValue, setName, setValueMethods inherited from class org.jdesktop.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
-
Constructor Details
-
Header
public Header()Creates a new Header with a null name and value, and no elements. -
Header
Creates a new Header with the given name and value, and no elements.- Parameters:
name- The name. May be null.value- The value. May be null.
-
Header
Creates a new Header with the given name, value, and elements. Ifelementsis null, then an empty set of elements will be used instead.- Parameters:
name- The name. May be null.value- The value. May be null.elements- The elements. May be null. If null, then getElements() will return an empty array, rather than null.
-
-
Method Details
-
getElements
Returns an array of Elements for this Header. This array returned will never be null. A new array instance will be returned for every invocation of this method.- Returns:
- array of Elements. This will never be null.
-
setElements
Sets the elements. If theelementsparam is null, this will set the empty set of elements. That is, getElements() will return an empty array rather than null.- Parameters:
elements- The Elements. May be null. Replaces the old array of elements.
-
toString
- Overrides:
toStringin classNameValuePair
-