UNPKG

@hashgraph/solo

Version:

An opinionated CLI tool to deploy and manage private Hedera Networks.

32 lines 1.14 kB
import { MissingParentResourceRefError } from '../errors/missing_parent_resource_error.js'; import { MissingResourceNameError } from '../errors/missing_resource_name_error.js'; export class NestedResourceRef { parentRef; name; constructor(parentRef, name) { this.parentRef = parentRef; this.name = name; if (!parentRef) { throw new MissingParentResourceRefError(); } if (!name) { throw new MissingResourceNameError(); } } /** * Compares this instance with another NestedResourceRef. * @param other The other NestedResourceRef instance. * @returns true if both instances have the same parent reference and name. */ equals(other) { return other instanceof NestedResourceRef && this.parentRef.equals(other.parentRef) && this.name.equals(other.name); } /** * Allows implicit conversion to a string. * @returns The nested resource reference as a string. */ toString() { return `{parentRef: ${this.parentRef}, name: ${this.name}}`; } } //# sourceMappingURL=nested_resource_ref.js.map