Class GenericVersionConstraint

  • All Implemented Interfaces:
    VersionConstraint

    final class GenericVersionConstraint
    extends java.lang.Object
    implements VersionConstraint
    A constraint on versions for a dependency.
    • Constructor Detail

      • GenericVersionConstraint

        GenericVersionConstraint​(VersionRange range)
        Creates a version constraint from the specified version range.
        Parameters:
        range - The version range, must not be null.
      • GenericVersionConstraint

        GenericVersionConstraint​(Version version)
        Creates a version constraint from the specified version.
        Parameters:
        version - The version, must not be null.
    • Method Detail

      • containsVersion

        public boolean containsVersion​(Version version)
        Description copied from interface: VersionConstraint
        Determines whether the specified version satisfies this constraint. In more detail, a version satisfies this constraint if it matches its version range or if this constraint has no version range and the specified version equals the version recommended by the constraint.
        Specified by:
        containsVersion in interface VersionConstraint
        Parameters:
        version - The version to test, must not be null.
        Returns:
        true if the specified version satisfies this constraint, false otherwise.
      • toString

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

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

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

        private static int hash​(java.lang.Object obj)