"""Lighweight Node to bridge to BSFS. Part of the bsie module. A copy of the license is provided with the project. Author: Matthias Baumgartner, 2022 """ # imports import typing # bsie imports from bsie.utils.bsfs import URI, typename # exports __all__: typing.Sequence[str] = ( 'Node', ) ## code ## class Node(): """Lightweight Node, disconnected from any bsfs structures.""" # node type. node_type: URI # node URI. uri: URI def __init__( self, node_type: URI, uri: URI, ): # assign members self.node_type = URI(node_type) self.uri = URI(uri) def __eq__(self, other: typing.Any) -> bool: return isinstance(other, Node) \ and other.node_type == self.node_type \ and other.uri == self.uri def __hash__(self) -> int: return hash((type(self), self.node_type, self.uri)) def __str__(self) -> str: return f'{typename(self)}({self.node_type}, {self.uri})' def __repr__(self) -> str: return f'{typename(self)}({self.node_type}, {self.uri})' ## EOF ##