Class Coordinates

  • All Implemented Interfaces:
    java.lang.Comparable<Coordinates>

    class Coordinates
    extends java.lang.Object
    implements java.lang.Comparable<Coordinates>
    Simple "record" to hold the coordinates of the dependency which is excluded.

    When dealing with exclusions the version is not important. Only groupId and artifactId is used.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String artifactId  
      private org.apache.maven.model.Dependency dependency  
      private java.lang.String groupId  
      private org.apache.maven.model.InputLocation location  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Coordinates​(java.lang.String groupId, java.lang.String artifactId, org.apache.maven.model.Dependency dependency, org.apache.maven.model.InputLocation location)  
    • Field Detail

      • groupId

        private final java.lang.String groupId
      • artifactId

        private final java.lang.String artifactId
      • dependency

        private final org.apache.maven.model.Dependency dependency
      • location

        private final org.apache.maven.model.InputLocation location
    • Constructor Detail

      • Coordinates

        private Coordinates​(java.lang.String groupId,
                            java.lang.String artifactId,
                            org.apache.maven.model.Dependency dependency,
                            org.apache.maven.model.InputLocation location)
    • Method Detail

      • coordinates

        public static Coordinates coordinates​(java.lang.String groupId,
                                              java.lang.String artifactId)
      • coordinates

        public static Coordinates coordinates​(org.apache.maven.model.Dependency dependency)
      • coordinates

        public static Coordinates coordinates​(org.apache.maven.model.Exclusion exclusion)
      • getGroupId

        public java.lang.String getGroupId()
      • getArtifactId

        public java.lang.String getArtifactId()
      • getDependency

        public org.apache.maven.model.Dependency getDependency()
      • getExclusionPattern

        java.util.function.Predicate<Coordinates> getExclusionPattern()
      • createPathProxy

        private static java.nio.file.Path createPathProxy​(java.lang.String value)
        In order to reuse the glob matcher from the filesystem, we need to create Path instances. Those are only used with the toString method. This hack works because the only system-dependent thing is the path separator which should not be part of the groupId or artifactId.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Coordinates that)
        Specified by:
        compareTo in interface java.lang.Comparable<Coordinates>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object