DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file, Map<String, String> properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); this.nature = nature; this.file = file; this.properties = properties; }
DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file, Map<String, String> properties ) { // NOTE: This constructor assumes immutability of the provided properties, for internal use only this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); this.nature = nature; this.file = file; this.properties = properties; }
/** * Creates a new metadata for the groupId:artifactId:version level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param version The version to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. * @param properties The properties of the metadata, may be {@code null} if none. * @param file The resolved file of the metadata, may be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, Map<String, String> properties, File file ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); this.nature = requireNonNull( nature, "metadata nature cannot be null" ); this.file = file; this.properties = copyProperties( properties ); }
/** * Creates a new metadata for the groupId:artifactId:version level with the specific type and nature. * * @param groupId The group identifier to which this metadata applies, may be {@code null}. * @param artifactId The artifact identifier to which this metadata applies, may be {@code null}. * @param version The version to which this metadata applies, may be {@code null}. * @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}. * @param nature The nature of the metadata, must not be {@code null}. * @param properties The properties of the metadata, may be {@code null} if none. * @param file The resolved file of the metadata, may be {@code null}. */ public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, Map<String, String> properties, File file ) { this.groupId = emptify( groupId ); this.artifactId = emptify( artifactId ); this.version = emptify( version ); this.type = emptify( type ); if ( nature == null ) { throw new IllegalArgumentException( "metadata nature was not specified" ); } this.nature = nature; this.file = file; this.properties = copyProperties( properties ); }