@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
32 lines • 1.05 kB
JavaScript
import { MissingNamespaceError } from '../errors/missing_namespace_error.js';
import { MissingResourceNameError } from '../errors/missing_resource_name_error.js';
export class ResourceRef {
namespace;
name;
constructor(namespace, name) {
this.namespace = namespace;
this.name = name;
if (!namespace) {
throw new MissingNamespaceError();
}
if (!name) {
throw new MissingResourceNameError();
}
}
/**
* Compares this instance with another PodRef.
* @param other The other PodRef instance.
* @returns true if both instances have the same namespace name and pod name.
*/
equals(other) {
return other instanceof ResourceRef && this.namespace.equals(other.namespace) && this.name.equals(other.name);
}
/**
* Allows implicit conversion to a string.
* @returns The pod reference as a string.
*/
toString() {
return `${this.namespace}/${this.name}`;
}
}
//# sourceMappingURL=resource_ref.js.map