Class Dependencies


  • public class Dependencies
    extends java.lang.Object
    This is a simple container for Dependency objects. Rather than using a List this object allows operations like contains(Dependency) that work reliably even though Dependency class does not properly implement equals.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​org.apache.maven.model.Dependency> key2DependencyMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      Dependencies()
      The constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(org.apache.maven.model.Dependency dependency)  
      void addAll​(java.util.List<org.apache.maven.model.Dependency> dependencies)  
      boolean contains​(org.apache.maven.model.Dependency dependency)  
      protected java.lang.String getKey​(org.apache.maven.model.Dependency dependency)  
      org.apache.maven.model.Dependency resolve​(org.apache.maven.model.Dependency dependency)  
      java.util.List<org.apache.maven.model.Dependency> toList()  
      • Methods inherited from class java.lang.Object

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

      • key2DependencyMap

        private final java.util.Map<java.lang.String,​org.apache.maven.model.Dependency> key2DependencyMap
        See Also:
        add(Dependency)
    • Constructor Detail

      • Dependencies

        public Dependencies()
        The constructor.
    • Method Detail

      • getKey

        protected java.lang.String getKey​(org.apache.maven.model.Dependency dependency)
        Parameters:
        dependency - is the Dependency to put or get .
        Returns:
        the key for the Dependency.
      • addAll

        public void addAll​(java.util.List<org.apache.maven.model.Dependency> dependencies)
        Parameters:
        dependencies - the List of Dependency objects to add.
      • add

        public void add​(org.apache.maven.model.Dependency dependency)
        Parameters:
        dependency - the Dependency to add.
      • contains

        public boolean contains​(org.apache.maven.model.Dependency dependency)
        Parameters:
        dependency - the Dependency to test.
        Returns:
        true if the given Dependency is contained in these Dependencies, false otherwise.
      • resolve

        public org.apache.maven.model.Dependency resolve​(org.apache.maven.model.Dependency dependency)
        Parameters:
        dependency - the Dependency to resolve.
        Returns:
        a full declared Dependency
      • toList

        public java.util.List<org.apache.maven.model.Dependency> toList()
        Returns:
        a List with the Dependency objects contained in these Dependencies.