copyWith method

Node copyWith({
  1. String? nodeId,
  2. int? role,
  3. Value<String?> groupId = const Value.absent(),
  4. int? lastSeen,
  5. int? hopCount,
  6. Value<String?> displayName = const Value.absent(),
  7. Value<int?> batteryLevel = const Value.absent(),
  8. bool? hasInternetAccess,
  9. Value<String?> metadata = const Value.absent(),
})

Implementation

Node copyWith({
  String? nodeId,
  int? role,
  Value<String?> groupId = const Value.absent(),
  int? lastSeen,
  int? hopCount,
  Value<String?> displayName = const Value.absent(),
  Value<int?> batteryLevel = const Value.absent(),
  bool? hasInternetAccess,
  Value<String?> metadata = const Value.absent(),
}) => Node(
  nodeId: nodeId ?? this.nodeId,
  role: role ?? this.role,
  groupId: groupId.present ? groupId.value : this.groupId,
  lastSeen: lastSeen ?? this.lastSeen,
  hopCount: hopCount ?? this.hopCount,
  displayName: displayName.present ? displayName.value : this.displayName,
  batteryLevel: batteryLevel.present ? batteryLevel.value : this.batteryLevel,
  hasInternetAccess: hasInternetAccess ?? this.hasInternetAccess,
  metadata: metadata.present ? metadata.value : this.metadata,
);