public static Version getStrictVersion ( Collection < ? extends VersionRangeCollection > ranges ) { for ( VersionRangeCollection collection : ranges ) { if ( collection . getRanges ( ) . size ( ) == 1 ) { VersionRange range = collection . getRanges ( ) . iterator ( ) . next ( ) ; if ( range instanceof DefaultVersionRange ) { DefaultVersionRange defaultRange = ( DefaultVersionRange ) range ; Version lowerBound = defaultRange . getLowerBound ( ) ; if ( lowerBound != null && ( lowerBound . equals ( defaultRange . getUpperBound ( ) ) ) ) { return lowerBound ; } } } } return null ; }
Check if passed range collection is a strict version .