/** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param properties The properties for artifacts of this type, may be {@code null}. */ public DefaultArtifactType( String id, String extension, String classifier, Map<String, String> properties ) { if ( id == null || id.length() < 0 ) { throw new IllegalArgumentException( "no type id specified" ); } this.id = id; this.extension = emptify( extension ); this.classifier = emptify( classifier ); this.properties = AbstractArtifact.copyProperties( properties ); }
/** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param properties The properties for artifacts of this type, may be {@code null}. */ public DefaultArtifactType( String id, String extension, String classifier, Map<String, String> properties ) { this.id = requireNonNull( id, "type id cannot be null" ); if ( id.length() == 0 ) { throw new IllegalArgumentException( "type id cannot be empty" ); } this.extension = emptify( extension ); this.classifier = emptify( classifier ); this.properties = AbstractArtifact.copyProperties( properties ); }
/** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE} * property, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param language The value for the {@link ArtifactProperties#LANGUAGE} property, may be {@code null}. * @param constitutesBuildPath The value for the {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} property. * @param includesDependencies The value for the {@link ArtifactProperties#INCLUDES_DEPENDENCIES} property. */ public DefaultArtifactType( String id, String extension, String classifier, String language, boolean constitutesBuildPath, boolean includesDependencies ) { if ( id == null || id.length() < 0 ) { throw new IllegalArgumentException( "no type id specified" ); } this.id = id; this.extension = emptify( extension ); this.classifier = emptify( classifier ); Map<String, String> props = new HashMap<String, String>(); props.put( ArtifactProperties.TYPE, id ); props.put( ArtifactProperties.LANGUAGE, ( language != null && language.length() > 0 ) ? language : "none" ); props.put( ArtifactProperties.INCLUDES_DEPENDENCIES, Boolean.toString( includesDependencies ) ); props.put( ArtifactProperties.CONSTITUTES_BUILD_PATH, Boolean.toString( constitutesBuildPath ) ); properties = Collections.unmodifiableMap( props ); }
/** * Creates a new artifact type with the specified properties. * * @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE} * property, must not be {@code null} or empty. * @param extension The usual file extension for artifacts of this type, may be {@code null}. * @param classifier The usual classifier for artifacts of this type, may be {@code null}. * @param language The value for the {@link ArtifactProperties#LANGUAGE} property, may be {@code null}. * @param constitutesBuildPath The value for the {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} property. * @param includesDependencies The value for the {@link ArtifactProperties#INCLUDES_DEPENDENCIES} property. */ public DefaultArtifactType( String id, String extension, String classifier, String language, boolean constitutesBuildPath, boolean includesDependencies ) { this.id = requireNonNull( id, "type id cannot be null" ); if ( id.length() == 0 ) { throw new IllegalArgumentException( "type id cannot be empty" ); } this.extension = emptify( extension ); this.classifier = emptify( classifier ); Map<String, String> props = new HashMap<String, String>(); props.put( ArtifactProperties.TYPE, id ); props.put( ArtifactProperties.LANGUAGE, ( language != null && language.length() > 0 ) ? language : "none" ); props.put( ArtifactProperties.INCLUDES_DEPENDENCIES, Boolean.toString( includesDependencies ) ); props.put( ArtifactProperties.CONSTITUTES_BUILD_PATH, Boolean.toString( constitutesBuildPath ) ); properties = Collections.unmodifiableMap( props ); }