// SPDX-License-Identifier: Apache-2.0
import { MissingNamespaceError } from '../errors/missing-namespace-error.js';
import { MissingResourceNameError } from '../errors/missing-resource-name-error.js';
export class ResourceReference {
    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 PodReference.
     * @param other The other PodReference instance.
     * @returns true if both instances have the same namespace name and pod name.
     */
    equals(other) {
        return other instanceof ResourceReference && 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-reference.js.map