public function get($fieldPath)
    {
        $res = null;

        if (is_string($fieldPath)) {
            $parts = explode('.', $fieldPath);
        } elseif ($fieldPath instanceof FieldPath) {
            $parts = $fieldPath->path();
        } else {
            throw new \InvalidArgumentException('Given path was not a string or instance of FieldPath.');
        }

        $len = count($parts);

        $fields = $this->data;
        foreach ($parts as $idx => $part) {
            if ($idx === $len-1 && isset($fields[$part])) {
                $res = $fields[$part];
                break;
            } else {
                if (!isset($fields[$part])) {
                    throw new \InvalidArgumentException(sprintf(
                        'Field path `%s` does not exist.',
                        $fieldPath
                    ));
                }

                $fields = $fields[$part];
            }
        }

        return $res;
    }