public static function build($p)
    {
        if (is_object($p)) {
            if ($p instanceof PosMap) {
                return $p;
            }
            $generated = isset($p->generated) ? $p->generated : null;
            $source = isset($p->source) ? $p->source : null;
        } elseif (is_array($p)) {
            $generated = isset($p['generated']) ? $p['generated'] : null;
            $source = isset($p['source']) ? $p['source'] : null;
        } else {
            $generated = null;
            $source = null;
        }
        return new PosMap($generated, $source);
    }