private CompoundVersionSpec getCompoundVersionSpec( List<VersionSpec> specs ) { return new CompoundVersionSpec( rawSpec, specs ); }
public boolean isRelease() { return !isSnapshot(); }
private static int compareCompoundToCompound( final CompoundVersionSpec first, final CompoundVersionSpec second ) { final VersionSpec ff = first.getFirstComponent(); final VersionSpec sf = second.getFirstComponent(); final int fc = compareTo( ff, sf ); final VersionSpec fl = first.getLastComponent(); final VersionSpec sl = second.getLastComponent(); final int lc = compareTo( fl, sl ); final int comp = fc + lc; if ( comp == 0 ) { return 0; } else if ( comp < 0 ) { return -1; } else { return 1; } }
@Override public String toString() { final StringBuilder sb = new StringBuilder(); sb.append( "CompoundVersion: [" ); for ( final VersionSpec spec : specs ) { sb.append( "\n " ) .append( spec ); } sb.append( "\n]\n(" ) .append( renderStandard() ) .append( ")" ); return sb.toString(); }
private static int compareRangeToCompound( final RangeVersionSpec first, final CompoundVersionSpec second ) { final int fc = compareTo( first, second.getFirstComponent() ); final int lc = compareTo( first, second.getLastComponent() ); final int comp = fc + lc; if ( comp == 0 ) { return 0; } else if ( comp < 0 ) { return -1; } else { return 1; } }
private VersionSpec generateVersionSpec( final Set<ProjectVersionRef> refs, final boolean generateVersionRanges ) { final List<VersionSpec> versions = new ArrayList<>(); for ( final ProjectVersionRef ref : refs ) { final VersionSpec spec = ref.getVersionSpec(); versions.add( spec ); } Collections.sort( versions ); if ( !generateVersionRanges || versions.size() == 1 ) { return versions.get( 0 ); } return new CompoundVersionSpec( null, versions ); }
private static int compareSingleToCompound( final SingleVersion first, final CompoundVersionSpec second ) { final int fc = compareTo( first, second.getFirstComponent() ); final int lc = compareTo( first, second.getLastComponent() ); final int comp = fc + lc; if ( comp == 0 ) { return 0; } else if ( comp < 0 ) { return -1; } else { return 1; } }
private VersionSpec generateVersionSpec( final Set<ProjectVersionRef> refs, final boolean generateVersionRanges ) { final List<VersionSpec> versions = new ArrayList<>(); for ( final ProjectVersionRef ref : refs ) { final VersionSpec spec = ref.getVersionSpec(); versions.add( spec ); } Collections.sort( versions ); if ( !generateVersionRanges || versions.size() == 1 ) { return versions.get( 0 ); } return new CompoundVersionSpec( null, versions ); }