UNPKG

@hashgraph/sdk

Version:
76 lines (68 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; // SPDX-License-Identifier: Apache-2.0 class IPv4AddressPart { /** * @param {object} props * @param {number} [props.left] * @param {number} [props.right] */ constructor(props = {}) { /** * @type {number | null} */ this._left = null; if (props.left != null) { this.setLeft(props.left); } /** * @type {number | null} */ this._right = null; if (props.right != null) { this.setRight(props.right); } } /** * @returns {?number} */ get left() { return this._left; } /** * @param {number} part * @returns {this} */ setLeft(part) { this._left = part; return this; } /** * @returns {?number} */ get right() { return this._right; } /** * @param {number} part * @returns {this} */ setRight(part) { this._right = part; return this; } /** * @returns {string} */ toString() { if (this._left != null && this._right != null) { return `${this._left.toString()}.${this._right.toString()}`; } else { return ""; } } } exports.default = IPv4AddressPart;