Skip to content

Commit

Permalink
docs: update docs for NodeConfigData class
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jan 31, 2025
1 parent 0e3c3f3 commit 6f6a81f
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions lib/src/core/utils/daemon_manager/node_config_data.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
/// [NodeConfigData] Documentation:
/// `NodeConfigData` is a singleton class that stores and manages
/// configuration data related to a Pactus blockchain node initialization .
///
/// ## Features:
/// - Implements the Singleton pattern to ensure a single instance.
/// - Provides getters and setters for essential configuration properties.
/// - Stores working directory, restoration seed, password, and validator
/// quantity.
///
/// ## Usage:
/// ```dart
/// final config = NodeConfigData.instance;
/// config.workingDirectory = "/path/to/dir";
/// print(config.workingDirectory);
/// ```
///
/// ## Notes:
/// - Default values are empty strings to prevent null issues.
class NodeConfigData {
// Private constructor
// Private constructor to enforce the Singleton pattern
NodeConfigData._internal();
// Singleton instance

/// The single instance of [NodeConfigData]
static final NodeConfigData instance = NodeConfigData._internal();

// Private variables
Expand All @@ -10,13 +30,13 @@ class NodeConfigData {
String? _password;
String? _validatorQty;

// Getters
// Getters - return empty strings if values are null
String get workingDirectory => _workingDirectory ?? '';
String get restorationSeed => _restorationSeed ?? '';
String get password => _password ?? '';
String get validatorQty => _validatorQty ?? '';

// Setters
// Setters - update private variables
set workingDirectory(String value) {
_workingDirectory = value;
}
Expand Down

0 comments on commit 6f6a81f

Please sign in to comment.