class AddressDto(object):
    def __init__(
        self,
        protocol: str,
        host: str,
        port: int
    ):
        self.protocol = protocol
        self.host = host
        self.port = port

    @staticmethod
    def build_from_str(address: str):
        protocol_index = address.index("://")
        port_index = address.index(":", protocol_index + 3)
        protocol = address[:protocol_index]
        host = address[protocol_index + 3:port_index]
        port = int(address[port_index + 1:])

        return AddressDto(
            protocol=protocol,
            host=host,
            port=port,
        )

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False

        return self.protocol == other.protocol and self.host == other.host and self.port == other.port
