Class DefaultArtifactType

  • All Implemented Interfaces:
    ArtifactType

    public final class DefaultArtifactType
    extends java.lang.Object
    implements ArtifactType
    A simple artifact type.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String classifier  
      private java.lang.String extension  
      private java.lang.String id  
      private java.util.Map<java.lang.String,​java.lang.String> properties  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultArtifactType​(java.lang.String id)
      Creates a new artifact type with the specified identifier.
      DefaultArtifactType​(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.String language)
      Creates a new artifact type with the specified properties.
      DefaultArtifactType​(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.lang.String language, boolean constitutesBuildPath, boolean includesDependencies)
      Creates a new artifact type with the specified properties.
      DefaultArtifactType​(java.lang.String id, java.lang.String extension, java.lang.String classifier, java.util.Map<java.lang.String,​java.lang.String> properties)
      Creates a new artifact type with the specified properties.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String emptify​(java.lang.String str)  
      java.lang.String getClassifier()
      Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).
      java.lang.String getExtension()
      Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).
      java.lang.String getId()
      Gets the identifier of this type, e.g.
      java.util.Map<java.lang.String,​java.lang.String> getProperties()
      Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        private final java.lang.String id
      • extension

        private final java.lang.String extension
      • classifier

        private final java.lang.String classifier
      • properties

        private final java.util.Map<java.lang.String,​java.lang.String> properties
    • Constructor Detail

      • DefaultArtifactType

        public DefaultArtifactType​(java.lang.String id,
                                   java.lang.String extension,
                                   java.lang.String classifier,
                                   java.lang.String language)
        Creates a new artifact type with the specified properties. Additionally, the properties ArtifactProperties.CONSTITUTES_BUILD_PATH and ArtifactProperties.INCLUDES_DEPENDENCIES will be set to true and false, respectively.
        Parameters:
        id - The identifier of the type which will also be used as the value for the ArtifactProperties.TYPE property, must not be null or empty.
        extension - The usual file extension for artifacts of this type, may be null.
        classifier - The usual classifier for artifacts of this type, may be null.
        language - The value for the ArtifactProperties.LANGUAGE property, may be null.
      • DefaultArtifactType

        public DefaultArtifactType​(java.lang.String id,
                                   java.lang.String extension,
                                   java.lang.String classifier,
                                   java.lang.String language,
                                   boolean constitutesBuildPath,
                                   boolean includesDependencies)
        Creates a new artifact type with the specified properties.
        Parameters:
        id - The identifier of the type which will also be used as the value for the ArtifactProperties.TYPE property, must not be null or empty.
        extension - The usual file extension for artifacts of this type, may be null.
        classifier - The usual classifier for artifacts of this type, may be null.
        language - The value for the ArtifactProperties.LANGUAGE property, may be null.
        constitutesBuildPath - The value for the ArtifactProperties.CONSTITUTES_BUILD_PATH property.
        includesDependencies - The value for the ArtifactProperties.INCLUDES_DEPENDENCIES property.
      • DefaultArtifactType

        public DefaultArtifactType​(java.lang.String id,
                                   java.lang.String extension,
                                   java.lang.String classifier,
                                   java.util.Map<java.lang.String,​java.lang.String> properties)
        Creates a new artifact type with the specified properties.
        Parameters:
        id - The identifier of the type, must not be null or empty.
        extension - The usual file extension for artifacts of this type, may be null.
        classifier - The usual classifier for artifacts of this type, may be null.
        properties - The properties for artifacts of this type, may be null.
    • Method Detail

      • emptify

        private static java.lang.String emptify​(java.lang.String str)
      • getId

        public java.lang.String getId()
        Description copied from interface: ArtifactType
        Gets the identifier of this type, e.g. "maven-plugin" or "test-jar".
        Specified by:
        getId in interface ArtifactType
        Returns:
        The identifier of this type, never null.
        See Also:
        ArtifactProperties.TYPE
      • getExtension

        public java.lang.String getExtension()
        Description copied from interface: ArtifactType
        Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).
        Specified by:
        getExtension in interface ArtifactType
        Returns:
        The usual file extension, never null.
      • getClassifier

        public java.lang.String getClassifier()
        Description copied from interface: ArtifactType
        Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).
        Specified by:
        getClassifier in interface ArtifactType
        Returns:
        The usual classifier or an empty string if none, never null.
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Description copied from interface: ArtifactType
        Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).
        Specified by:
        getProperties in interface ArtifactType
        Returns:
        The (read-only) properties, never null.
        See Also:
        ArtifactProperties