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
public class HandshakedataImpl1 extends Object implements HandshakeBuilder
Implementation of a handshake builder
-
-
Constructor Summary
Constructors Constructor Description HandshakedataImpl1()
Constructor for handshake implementation
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getContent()
Get the content of the handshakeString
getFieldValue(String name)
Gets the value of the fieldboolean
hasFieldValue(String name)
Checks if this handshake contains a specific fieldIterator<String>
iterateHttpFields()
Iterator for the http fieldsvoid
put(String name, String value)
Adding a specific field with a specific valuevoid
setContent(byte[] content)
Setter for the content of the handshake
-
-
-
Method Detail
-
iterateHttpFields
public Iterator<String> iterateHttpFields()
Description copied from interface:Handshakedata
Iterator for the http fields- Specified by:
iterateHttpFields
in interfaceHandshakedata
- Returns:
- the http fields
-
getFieldValue
public String getFieldValue(String name)
Description copied from interface:Handshakedata
Gets the value of the field- Specified by:
getFieldValue
in 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:Handshakedata
Get the content of the handshake- Specified by:
getContent
in interfaceHandshakedata
- Returns:
- the content as byte-array
-
setContent
public void setContent(byte[] content)
Description copied from interface:HandshakeBuilder
Setter for the content of the handshake- Specified by:
setContent
in interfaceHandshakeBuilder
- Parameters:
content
- the content to set
-
put
public void put(String name, String value)
Description copied from interface:HandshakeBuilder
Adding a specific field with a specific value- Specified by:
put
in interfaceHandshakeBuilder
- Parameters:
name
- the http fieldvalue
- the value for this field
-
hasFieldValue
public boolean hasFieldValue(String name)
Description copied from interface:Handshakedata
Checks if this handshake contains a specific field- Specified by:
hasFieldValue
in interfaceHandshakedata
- Parameters:
name
- The name of the field- Returns:
- true, if it contains the field
-
-