@Test public void testLowerBoundInclusiveUpperBoundInclusive() { VersionRange range = parseValid( "[1,2]" ); assertContains( range, "1" ); assertContains( range, "1.1-SNAPSHOT" ); assertContains( range, "2" ); assertEquals( range, parseValid( range.toString() ) ); }
@Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); }
GenericVersionRange implements VersionRange { @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); } }
GenericVersionRange implements VersionRange { @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); } GenericVersionRange( String range ); }
GenericVersionRange implements VersionRange { @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); } GenericVersionRange( String range ); Bound getLowerBound(); Bound getUpperBound(); boolean containsVersion( Version version ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString(); }
GenericVersionRange implements VersionRange { @Override public String toString() { StringBuilder buffer = new StringBuilder( 64 ); if ( lowerBound != null ) { buffer.append( lowerBound.isInclusive() ? '[' : '(' ); buffer.append( lowerBound.getVersion() ); } else { buffer.append( '(' ); } buffer.append( ',' ); if ( upperBound != null ) { buffer.append( upperBound.getVersion() ); buffer.append( upperBound.isInclusive() ? ']' : ')' ); } else { buffer.append( ')' ); } return buffer.toString(); } GenericVersionRange( String range ); Bound getLowerBound(); Bound getUpperBound(); boolean containsVersion( Version version ); @Override boolean equals( Object obj ); @Override int hashCode(); @Override String toString();  }