Sha256: f99f831a2f97e73f1daec9b30e90e0b367498406c55f573d38db32e747fbf054

Contents?: true

Size: 838 Bytes

Versions: 3

Compression:

Stored size: 838 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

3 entries across 3 versions & 1 rubygems

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