@hashgraph/solo
Version:
An opinionated CLI tool to deploy and manage private Hedera Networks.
57 lines (48 loc) • 1.43 kB
text/typescript
// SPDX-License-Identifier: Apache-2.0
import {LoadImageArchiveOptions} from './load-image-archive-options.js';
export class LoadImageArchiveOptionsBuilder {
private constructor(
private _archivePath?: string,
private _name?: string,
private _nodes?: string,
) {}
public static builder(): LoadImageArchiveOptionsBuilder {
return new LoadImageArchiveOptionsBuilder();
}
/**
* Set the archive path.
* @param archivePath
*/
public archivePath(archivePath: string): LoadImageArchiveOptionsBuilder {
this._archivePath = archivePath;
return this;
}
/**
* Set the name of the cluster (default "kind").
* @param name
*/
public name(name: string): LoadImageArchiveOptionsBuilder {
this._name = name;
return this;
}
/**
* Set the nodes to load images into.
* @param nodes
*/
public nodes(nodes: string): LoadImageArchiveOptionsBuilder {
this._nodes = nodes;
return this;
}
/**
* Build the LoadImageArchiveOptions instance.
*/
public build(): LoadImageArchiveOptions {
return new LoadImageArchiveOptions(this._archivePath, this._name, this._nodes);
}
public static from(options: LoadImageArchiveOptions): LoadImageArchiveOptionsBuilder {
if (!options) {
return new LoadImageArchiveOptionsBuilder();
}
return new LoadImageArchiveOptionsBuilder(options.archivePath, options.name, options.nodes);
}
}