* @param sourceRange the source version range
* @param delegateVersion the delegate version
*/
public void addMapping( @Nonnull VersionRange sourceRange, @Nonnull Version delegateVersion ) throws VersionException {
if ( !sourceVersionRange.containsCompletely( sourceRange ) ) {
throw new UnsupportedVersionRangeException( sourceRange, sourceVersionRange, "Invalid source range: " );
}
if ( !delegateVersionRange.contains( delegateVersion ) ) {
throw new UnsupportedVersionException( delegateVersion, delegateVersionRange, "Invalid delegate version: " );
}
//Exists still a mapping?
if ( containsMappingIn( sourceRange ) ) {
throw new UnsupportedVersionRangeException( sourceRange, null, "The version range has still been mapped: " );
}
this.entries.add( new Entry( sourceRange, delegateVersion ) );
}