public function keySetObject()
    {
        $ranges = [];
        foreach ($this->ranges as $range) {
            $ranges[] = $range->keyRangeObject();
        }

        $set = [];

        if ($this->all) {
            $set['all'] = true;
        }

        if ($this->keys) {
            $set['keys'] = $this->keys;
        }

        if ($ranges) {
            $set['ranges'] = $ranges;
        }

        return $set;
    }