<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: vector.proto

namespace Messages;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 *e.g. pk ( != | == | < | > ) value, else: execute algorithm(s)
 *
 * Generated from protobuf message <code>Messages.Rule</code>
 */
class Rule extends \Google\Protobuf\Internal\Message
{
    /**
     * serialized property-key <property|modifier|...>
     *
     * Generated from protobuf field <code>string pk = 1;</code>
     */
    protected $pk = '';
    /**
     * either: comparator enum (requirement), or relative priority number in queue
     *
     * Generated from protobuf field <code>uint32 op = 2;</code>
     */
    protected $op = 0;
    /**
     * Generated from protobuf field <code>double value = 3;</code>
     */
    protected $value = 0.0;
    /**
     * names of algorithms to be associated
     *
     * Generated from protobuf field <code>repeated string algorithms = 4;</code>
     */
    private $algorithms;
    /**
     * Generated from protobuf field <code>repeated uint32 failed_nodes = 5 [packed = true];</code>
     */
    private $failed_nodes;
    /**
     * Generated from protobuf field <code>repeated double failed_values = 6 [packed = true];</code>
     */
    private $failed_values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $pk
     *           serialized property-key <property|modifier|...>
     *     @type int $op
     *           either: comparator enum (requirement), or relative priority number in queue
     *     @type float $value
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $algorithms
     *           names of algorithms to be associated
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $failed_nodes
     *     @type float[]|\Google\Protobuf\Internal\RepeatedField $failed_values
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Vector::initOnce();
        parent::__construct($data);
    }

    /**
     * serialized property-key <property|modifier|...>
     *
     * Generated from protobuf field <code>string pk = 1;</code>
     * @return string
     */
    public function getPk()
    {
        return $this->pk;
    }

    /**
     * serialized property-key <property|modifier|...>
     *
     * Generated from protobuf field <code>string pk = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPk($var)
    {
        GPBUtil::checkString($var, True);
        $this->pk = $var;

        return $this;
    }

    /**
     * either: comparator enum (requirement), or relative priority number in queue
     *
     * Generated from protobuf field <code>uint32 op = 2;</code>
     * @return int
     */
    public function getOp()
    {
        return $this->op;
    }

    /**
     * either: comparator enum (requirement), or relative priority number in queue
     *
     * Generated from protobuf field <code>uint32 op = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setOp($var)
    {
        GPBUtil::checkUint32($var);
        $this->op = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>double value = 3;</code>
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Generated from protobuf field <code>double value = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->value = $var;

        return $this;
    }

    /**
     * names of algorithms to be associated
     *
     * Generated from protobuf field <code>repeated string algorithms = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAlgorithms()
    {
        return $this->algorithms;
    }

    /**
     * names of algorithms to be associated
     *
     * Generated from protobuf field <code>repeated string algorithms = 4;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAlgorithms($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->algorithms = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated uint32 failed_nodes = 5 [packed = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFailedNodes()
    {
        return $this->failed_nodes;
    }

    /**
     * Generated from protobuf field <code>repeated uint32 failed_nodes = 5 [packed = true];</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFailedNodes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::UINT32);
        $this->failed_nodes = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated double failed_values = 6 [packed = true];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getFailedValues()
    {
        return $this->failed_values;
    }

    /**
     * Generated from protobuf field <code>repeated double failed_values = 6 [packed = true];</code>
     * @param float[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setFailedValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
        $this->failed_values = $arr;

        return $this;
    }

}

