All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hidetake.groovy.ssh.interaction.Context.groovy Maven / Gradle / Ivy

There is a newer version: 2.11.2
Show newest version
package org.hidetake.groovy.ssh.interaction

import groovy.util.logging.Slf4j

/**
 * A context class of stream interaction.
 * This should be pushed into the stack and replaced on rule matched.
 *
 * @author Hidetake Iwata
 */
@Slf4j
class Context {

    private final List rules

    def Context(List rules1) {
        rules = rules1
    }

    MatchResult match(Stream stream, Buffer buffer) {
        rules.findResult { rule ->
            rule.match(stream, buffer)
        }
    }

    @Override
    String toString() {
        "${Context.simpleName}$rules"
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy