Skip to content

Latest commit

 

History

History
75 lines (53 loc) · 1.85 KB

macaddress.adoc

File metadata and controls

75 lines (53 loc) · 1.85 KB

MacAddress

Represents MAC address

Instance attributes

isBroadcast ⇒ Boolean

TRUE if is broadcats address

isMulticast ⇒ Boolean

TRUE if multicast address

isValid ⇒ Boolean

TRUE if is valid MAC address

Instance methods

equals(mac) ⇒ Boolean

Compates two MAC addresses

Table 1. Parameters

mac

MacAddress

MAC address compate to

Return

TRUE if MAC addresses are equals

toString(notation) ⇒ String

Returnas MAC address string representation

Table 2. Parameters

notation

Constant

Optional. Notation of MAC address, one of MAC address notation options. MacAddressNotation::COLON_SEPARATED will be used by default if this parameter is not provided.

Return

MAC address as a string

Constructors

MacAddress(mac)

Creates new JSON object.

Table 3. Parameters

mac

String

Optional. String represenation of MAC address to parse to object

Return

MacAddress object

Constants

Table 4. MAC address notation
Constant Description

MacAddressNotation::FLAT_STRING

Without separator, e.g. 123456789ABC

MacAddressNotation::COLON_SEPARATED

Separated by colon, e.g. 12:34:56:78:9A:BC

MacAddressNotation::BYTEPAIR_COLON_SEPARATED

Bytepairs separated by colon, e.g. 1234:5678:9ABC

MacAddressNotation::HYPHEN_SEPARATED

Separated by hyphen, e.g. 12-34-56-78-9A-BC

MacAddressNotation::DOT_SEPARATED

Separated by dot, e.g. 123.456.789.ABC

MacAddressNotation::BYTEPAIR_DOT_SEPARATED

Bytepairs separated by dot, e.g. 1234.5678.9ABC

MacAddressNotation::DECIMAL_DOT_SEPARATED

Decimal, separated by dot, e.g. 18.52.86.120.154.188