private function fromDefinition($type, $startOrEnd)
    {
        if (!array_key_exists($type, $this->definition)) {
            throw new \InvalidArgumentException(sprintf(
                'Invalid KeyRange %s type. Allowed values are %s.',
                $startOrEnd,
                implode(', ', array_keys($this->definition))
            ));
        }

        return $this->definition[$type][$startOrEnd];
    }