@@ -94,7 +94,6 @@ public PackageURL(final String type, final String name) throws MalformedPackageU
9494 public PackageURL (final String type , final String namespace , final String name , final String version ,
9595 final TreeMap <String , String > qualifiers , final String subpath )
9696 throws MalformedPackageURLException {
97-
9897 this .scheme = validateScheme ("pkg" );
9998 this .type = validateType (type );
10099 this .namespace = validateNamespace (namespace );
@@ -105,6 +104,24 @@ public PackageURL(final String type, final String namespace, final String name,
105104 verifyTypeConstraints (this .type , this .namespace , this .name );
106105 }
107106
107+ /**
108+ * Constructs a new PackageURL object.
109+ *
110+ * @param type the type of package (i.e. maven, npm, gem, etc)
111+ * @param namespace the name prefix (i.e. group, owner, organization)
112+ * @param name the name of the package
113+ * @param version the version of the package
114+ * @param qualifiers an array of key/value pair qualifiers
115+ * @param subpath the subpath string
116+ * @throws MalformedPackageURLException if parsing fails
117+ * @since 1.0.0
118+ */
119+ public PackageURL (final String type , final String namespace , final String name , final String version ,
120+ final Map <String , String > qualifiers , final String subpath )
121+ throws MalformedPackageURLException {
122+ this (type , namespace , name , version , (qualifiers == null ) ? null : ((qualifiers instanceof TreeMap ) ? (TreeMap <String , String >) qualifiers : new TreeMap <>(qualifiers )), subpath );
123+ }
124+
108125 /**
109126 * The PackageURL scheme constant
110127 */
0 commit comments