MessageBuilder

scamper.http.MessageBuilder

Provides builder pattern for HTTP message.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
T

Members list

Value members

Abstract methods

def setAttributes(attributes: Map[String, Any]): T

Creates message with supplied attributes.

Creates message with supplied attributes.

Value parameters

attributes

message attributes

Attributes

Returns

new message

Note

All previous attributes are removed.

def setBody(body: Entity): T

Creates message with supplied body.

Creates message with supplied body.

Value parameters

body

message body

Attributes

Returns

new message

def setHeaders(headers: Seq[Header]): T

Creates message with supplied headers.

Creates message with supplied headers.

Value parameters

headers

message headers

Attributes

Returns

new message

Note

All previous headers are removed.

def setStartLine(startLine: <none>): T

Creates message with supplied start line.

Creates message with supplied start line.

Value parameters

startLine

message start line

Attributes

Returns

new message

Concrete methods

def addHeaders(headers: Seq[Header]): T

Creates message with additional headers.

Creates message with additional headers.

Value parameters

headers

message headers

Attributes

Returns

new message

def addHeaders(one: Header, more: Header*): T

Creates message with additional headers.

Creates message with additional headers.

Value parameters

more

additional message headers

one

message header

Attributes

Returns

new message

def putAttributes(attributes: Map[String, Any]): T

Creates message with supplied attribute.

Creates message with supplied attribute.

Value parameters

attributes

attributes

Attributes

Returns

new message

Note

If attribute already exists, its value is replaced.

def putAttributes(one: (String, Any), more: (String, Any)*): T

Creates message with supplied attributes.

Creates message with supplied attributes.

Value parameters

more

additional attribute

one

attribute

Attributes

Returns

new message

Note

If attribute already exists, its value is replaced.

def putHeaders(headers: Seq[Header]): T

Creates message with supplied headers.

Creates message with supplied headers.

Value parameters

headers

message headers

Attributes

Returns

new message

Note

All previous headers with same name are removed.

def putHeaders(one: Header, more: Header*): T

Creates message with supplied headers.

Creates message with supplied headers.

Value parameters

more

additional headers

one

header

Attributes

Returns

new message

Note

All previous headers with same name are removed.

def removeAttributes(names: Seq[String]): T

Creates message excluding attributes with given names.

Creates message excluding attributes with given names.

Value parameters

names

attribute names

Attributes

Returns

new message

def removeAttributes(one: String, more: String*): T

Creates message excluding attributes with given names.

Creates message excluding attributes with given names.

Value parameters

more

additional attribute names

one

attribute name

Attributes

Returns

new message

def removeHeaders(names: Seq[String]): T

Creates message excluding headers with given names.

Creates message excluding headers with given names.

Value parameters

names

header names

Attributes

Returns

new message

def removeHeaders(one: String, more: String*): T

Creates message excluding headers with given names.

Creates message excluding headers with given names.

Value parameters

more

additional header names

one

header name

Attributes

Returns

new message

def setAttributes(one: (String, Any), more: (String, Any)*): T

Creates message with supplied attributes.

Creates message with supplied attributes.

Value parameters

more

additional message attributes

one

message attribute

Attributes

Returns

new message

Note

All previous attributes are removed.

def setBody(body: InputStream): T

Creates message with supplied body.

Creates message with supplied body.

Value parameters

body

message body

Attributes

Returns

new message

def setBody(body: Array[Byte]): T

Creates message with supplied body.

Creates message with supplied body.

Value parameters

body

message body

Attributes

Returns

new message

def setBody(body: String): T

Creates message with supplied body.

Creates message with supplied body.

Value parameters

body

message body

Attributes

Returns

new message

def setHeaders(one: Header, more: Header*): T

Creates message with supplied headers.

Creates message with supplied headers.

Value parameters

more

additional message headers

one

message header

Attributes

Returns

new message

Note

All previous headers are removed.