Sha256: 85eea0d0a59ac8b28a9c521466526653b35494d818b2dfbbdaae9e181b84dd91

Contents?: true

Size: 647 Bytes

Versions: 25

Compression:

Stored size: 647 Bytes

Contents

from javonet.core.handler.HandlerDictionary import handler_dict
from javonet.utils.Command import Command


class AbstractCommandHandler:
    _required_parameters_count = 0

    def process(self, command):
        pass

    def handle_command(self, command):
        self.__iterate(command)
        return self.process(command)

    @staticmethod
    def __iterate(command):
        for i in range(0, len(command.payload)):
            if isinstance(command.payload[i], Command):
                command.payload[i] = handler_dict.get(command.payload[i].command_type).handle_command(
                        command.payload[i])

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.1.5 lib/javonet-ruby-sdk/Binaries/Python/Windows/X64/javonet/core/handler/CommandHandler/AbstractCommandHandler.py
javonet-ruby-sdk-2.1.4 lib/javonet-ruby-sdk/Binaries/Python/Windows/X64/javonet/core/handler/CommandHandler/AbstractCommandHandler.py
javonet-ruby-sdk-2.1.3 lib/javonet-ruby-sdk/Binaries/Python/Windows/X64/javonet/core/handler/CommandHandler/AbstractCommandHandler.py
javonet-ruby-sdk-2.1.2 lib/javonet-ruby-sdk/Binaries/Python/Windows/X64/javonet/core/handler/CommandHandler/AbstractCommandHandler.py
javonet-ruby-sdk-2.1.1 lib/javonet-ruby-sdk/Binaries/Python/Windows/X64/javonet/core/handler/CommandHandler/AbstractCommandHandler.py