C# Класс StompNet.Models.Frames.Frame

Class representing a STOMP FRAME. No validation is done here except a command string is required. All validations must be done in inheritors. This object is not immutable, BUT should be used as if it were.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
EmptyBody byte[]
HeartbeatFrame Frame

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
Frame ( string command, string>.IEnumerable headers, byte body = null ) : System

Constructor.

GetAllHeaderValues ( string name ) : IEnumerable

Gets all the values of the specified header.

GetBodyAsString ( ) : string

Get body as a string using UTF-8 encoding.

GetBodyAsString ( Encoding encoding ) : string

Get body as a string using the specified encoding.

GetHeader ( string name ) : string

Gets the value of the first ocurrence of the specified header.

ToString ( ) : string

String representation of the Frame.

Защищенные методы

Метод Описание
ThrowMandatoryHeaderException ( string headerName ) : void

Create and throws the exception used when a mandatory header is not included.

Описание методов

Frame() публичный Метод

Constructor.
public Frame ( string command, string>.IEnumerable headers, byte body = null ) : System
command string Frame command.
headers string>.IEnumerable Frame headers.
body byte Frame body.
Результат System

GetAllHeaderValues() публичный Метод

Gets all the values of the specified header.
public GetAllHeaderValues ( string name ) : IEnumerable
name string Name of the header.
Результат IEnumerable

GetBodyAsString() публичный Метод

Get body as a string using UTF-8 encoding.
public GetBodyAsString ( ) : string
Результат string

GetBodyAsString() публичный Метод

Get body as a string using the specified encoding.
public GetBodyAsString ( Encoding encoding ) : string
encoding System.Text.Encoding Encoding to be used to decode the message body.
Результат string

GetHeader() публичный Метод

Gets the value of the first ocurrence of the specified header.
public GetHeader ( string name ) : string
name string Name of the header.
Результат string

ThrowMandatoryHeaderException() защищенный статический Метод

Create and throws the exception used when a mandatory header is not included.
protected static ThrowMandatoryHeaderException ( string headerName ) : void
headerName string Name of the mandatory header.
Результат void

ToString() публичный Метод

String representation of the Frame.
public ToString ( ) : string
Результат string

Описание свойств

EmptyBody публичное статическое свойство

Value used when the body is empty.
public static byte[] EmptyBody
Результат byte[]

HeartbeatFrame публичное статическое свойство

Value to be used when a heartbeat is received.
public static Frame,StompNet.Models.Frames HeartbeatFrame
Результат Frame