Sha256: 94ea51e5d592e4afe27e11d91c90082c94959af5dccb54212f65284a71be4cc0

Contents?: true

Size: 810 Bytes

Versions: 6

Compression:

Stored size: 810 Bytes

Contents

const AbstractHandler = require('./AbstractHandler')

class SetStaticFieldHandler extends AbstractHandler {
    constructor() {
        super()
    }

    requiredParametersCount = 3

    process(command) {
        try {
            if (command.payload.length < this.requiredParametersCount) {
                throw new Error("Set static field parameters mismatch")
            }
            const {payload} = command
            let [obj, field, value] = payload
            if (typeof(obj[field]) === 'undefined') {
                throw new Error("Static field does not exist")
            }
            obj[field] = value
            return 0
        } catch (error) {
            throw this.process_stack_trace(error, this.constructor.name)
        }

    }
}

module.exports = new SetStaticFieldHandler()

Version data entries

6 entries across 3 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.1.10 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/SetStaticFieldHandler.js
javonet-ruby-sdk-2.1.10 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/SetStaticFieldHandler.js
javonet-ruby-sdk-2.1.9 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/SetStaticFieldHandler.js
javonet-ruby-sdk-2.1.9 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/SetStaticFieldHandler.js
javonet-ruby-sdk-2.1.8 lib/javonet-ruby-sdk/Binaries/Nodejs/Linux/X64/core/handler/SetStaticFieldHandler.js
javonet-ruby-sdk-2.1.8 lib/javonet-ruby-sdk/Binaries/Nodejs/MacOs/X64/core/handler/SetStaticFieldHandler.js