Package org.java_websocket.handshake
Class HandshakedataImpl1
java.lang.Object
org.java_websocket.handshake.HandshakedataImpl1
- All Implemented Interfaces:
HandshakeBuilder,Handshakedata
- Direct Known Subclasses:
HandshakeImpl1Client,HandshakeImpl1Server
Implementation of a handshake builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Get the content of the handshakegetFieldValue(String name) Gets the value of the fieldbooleanhasFieldValue(String name) Checks if this handshake contains a specific fieldIterator for the http fieldsvoidAdding a specific field with a specific valuevoidsetContent(byte[] content) Setter for the content of the handshake
-
Constructor Details
-
HandshakedataImpl1
public HandshakedataImpl1()Constructor for handshake implementation
-
-
Method Details
-
iterateHttpFields
Description copied from interface:HandshakedataIterator for the http fields- Specified by:
iterateHttpFieldsin interfaceHandshakedata- Returns:
- the http fields
-
getFieldValue
Description copied from interface:HandshakedataGets the value of the field- Specified by:
getFieldValuein interfaceHandshakedata- Parameters:
name- The name of the field- Returns:
- the value of the field or an empty String if not in the handshake
-
getContent
public byte[] getContent()Description copied from interface:HandshakedataGet the content of the handshake- Specified by:
getContentin interfaceHandshakedata- Returns:
- the content as byte-array
-
setContent
public void setContent(byte[] content) Description copied from interface:HandshakeBuilderSetter for the content of the handshake- Specified by:
setContentin interfaceHandshakeBuilder- Parameters:
content- the content to set
-
put
Description copied from interface:HandshakeBuilderAdding a specific field with a specific value- Specified by:
putin interfaceHandshakeBuilder- Parameters:
name- the http fieldvalue- the value for this field
-
hasFieldValue
Description copied from interface:HandshakedataChecks if this handshake contains a specific field- Specified by:
hasFieldValuein interfaceHandshakedata- Parameters:
name- The name of the field- Returns:
- true, if it contains the field
-