Sha256: 0904c48fa94af0fe6eaedfd2b3b4a8682b9b6a163d16a4dfb323b4dbd0957d47

Contents?: true

Size: 916 Bytes

Versions: 4

Compression:

Stored size: 916 Bytes

Contents

const AbstractHandler = require("./AbstractHandler");

class GetStaticFieldHandler extends AbstractHandler {
    requiredParametersCount = 2

    constructor() {
        super()
    }

    process(command) {
        try {
            if (command.payload.length < this.requiredParametersCount) {
                throw new Error("Array Static Field parameters mismatch")
            }
            const {payload} = command
            let type = payload[0]
            let field = payload[1]

            let staticField = type[field]
            if (typeof (staticField) === 'undefined') {
                throw new Error("Static field does not exist")
            } else {
                return staticField
            }
        } catch (error) {
            throw this.process_stack_trace(error, this.constructor.name)
        }
    }
}


module.exports = new GetStaticFieldHandler()

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/GetStaticFieldHandler.js
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/GetStaticFieldHandler.js
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/GetStaticFieldHandler.js
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Nodejs/Windows/X64/core/handler/GetStaticFieldHandler.js