public Version withPreRelease ( String newPreRelease ) { require ( newPreRelease != null , "newPreRelease is null" ) ; final String [ ] newPreReleaseParts = parsePreRelease ( newPreRelease ) ; return new Version ( this . major , this . minor , this . patch , newPreReleaseParts , this . buildMetaDataParts ) ; }
Creates a new Version from this one replacing only the pre - release part with the given String . All other parts will remain the same as in this Version . You can remove the pre - release part by passing an empty String .