本文整理了Java中com.github.zafarkhaja.semver.Version.toString()
方法的一些代码示例,展示了Version.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.toString()
方法的具体详情如下:
包路径:com.github.zafarkhaja.semver.Version
类名称:Version
方法名:toString
暂无
代码示例来源:origin: Graylog2/graylog2-server
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return version.toString();
}
代码示例来源:origin: Graylog2/graylog2-server
@Override
public void serialize(final Version value, final JsonGenerator gen, final SerializerProvider provider) throws IOException {
final String version = value.toString();
gen.writeString(version);
}
}
代码示例来源:origin: infinum/Android-Prince-of-Versions
public String value() {
return version.toString();
}
代码示例来源:origin: org.graylog2/graylog2-server
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return version.toString();
}
代码示例来源:origin: org.ajoberstar.reckon/reckon-core
@Override
public String toString() {
return version.toString();
}
代码示例来源:origin: org.zaproxy/zap
@Override
public String toString() {
return impl.toString();
}
}
代码示例来源:origin: reddr/LibScout
void inferExpectedSemver() {
Iterator<Version> it = version2ApiDiff.keySet().iterator();
Version old = it.next();
while (it.hasNext()) {
Version cur = it.next();
VersionWrapper.SEMVER sem = VersionWrapper.getExpectedSemver(old,cur);
version2ApiDiff.get(cur).expectedSemver = sem;
logger.debug(Utils.INDENT2 + "Expected SemVer:: " + old.toString() + " : " + cur.toString() + " -> " + sem.name());
old = cur;
}
}
代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump
public String nextSnapshotVersion(final String tag, final String tagPattern) {
Version v;
if (tag.matches(tagPattern)) {
final Pattern pattern = Pattern.compile(tagPattern);
final Matcher m = pattern.matcher(tag);
m.matches();
v = Version.valueOf(m.group(1)).incrementMinorVersion();
return v.toString();
}
return StringUtils.EMPTY;
}
代码示例来源:origin: reddr/LibScout
public Export(ApiDiff diff, boolean verbose) {
version = diff.v.toString();
apiCount = diff.apiCount;
apiAdditionsCount = diff.added.size();
apiDeletionsCount = diff.removed.size();
actualSemver = diff.actualSemver == null? "" : diff.actualSemver.name();
expectedSemver = diff.expectedSemver == null? "" : diff.expectedSemver.name();
for (IMethod m: diff.alternatives.keySet()) {
Set<String> apis = diff.alternatives.get(m).stream().map(IMethod::getSignature).collect(Collectors.toSet());
alternatives.put(m.getSignature(), apis);
}
if (verbose) {
apiAdditions = diff.added.stream().map(IMethod::getSignature).sorted().collect(Collectors.toSet());
apiDeletions = diff.removed.stream().map(IMethod::getSignature).sorted().collect(Collectors.toSet());
}
}
代码示例来源:origin: reddr/LibScout
public Export(LibDependencies deps) {
this.version = deps.version.toString();
for (IMethod m: deps.api2Dependencies.keySet())
this.api2Dependencies.put(m.getSignature(), deps.api2Dependencies.get(m).stream().map(c -> c.getDeclaredTarget().getSignature()).collect(Collectors.toSet()));
}
}
代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump
public String nextReleaseVersion(final String tag, final String tagPattern) {
Version v;
if (tag.matches(tagPattern)) {
final Pattern pattern = Pattern.compile(tagPattern);
final Matcher m = pattern.matcher(tag);
m.matches();
if (m.group(2).contains("-")) {
v = Version.valueOf(m.group(1));
} else {
v = Version.valueOf(m.group(1)).incrementPatchVersion();
}
return v.toString();
}
return StringUtils.EMPTY;
}
代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump
private static void changeVersion(final ArrayList<String> newFile, final File file) throws IOException {
String line;
final FileReader fr = new FileReader(file);
final BufferedReader br = new BufferedReader(fr);
while ((line = br.readLine()) != null) {
if (line.matches(VERSION_PATTERN)) {
final Pattern pattern = Pattern.compile(VERSION_PATTERN);
final Matcher m = pattern.matcher(line);
m.matches();
final Version v =
Version.valueOf(getGitVersion().versionIncrement(getVersao(), m.group(1), PATTERN_TAG));
line = line.replaceFirst("\\d+\\.\\d+\\.\\d+.*", v.toString() + "\"");
}
if ("snapshot".equalsIgnoreCase(getVersao()) && line.matches("ext.snapshotVersion = false")) {
line = line.replaceFirst("false", "true");
}
newFile.add(line);
}
br.close();
fr.close();
}
代码示例来源:origin: gradle.plugin.br.com.sabium/gradle-bump
public String nextPreReleaseVersion(final String releaseTag, final String releaseTagPattern) {
if (releaseTag.matches(releaseTagPattern)) {
final Pattern pattern = Pattern.compile(releaseTagPattern);
final Matcher m = pattern.matcher(releaseTag);
m.matches();
Version v = Version.valueOf(m.group(0));
if (!m.group(2).contains("-")) {
v = v.incrementPatchVersion().setPreReleaseVersion("rc").incrementPreReleaseVersion();
} else {
v = v.incrementPreReleaseVersion();
}
return v.toString();
}
return StringUtils.EMPTY;
}
代码示例来源:origin: infiniteautomation/ma-core-public
/**
* Setup the core and modules for request
* @param coreVersion
* @param moduleVersionState
*/
protected void setupModules(Version coreVersion, String moduleVersion) {
switch(coreVersion.getPreReleaseVersion()){
case "SNAPSHOT":
json.put("currentVersionState", UpgradeVersionState.DEVELOPMENT);
break;
default:
json.put("currentVersionState", UpgradeVersionState.PRODUCTION);
}
jsonModules.put("core", coreVersion.toString());
for(String module : modules) {
jsonModules.put(module, moduleVersion);
}
}
代码示例来源:origin: infiniteautomation/ma-core-public
/**
* Setup the core and modules for request
* @param coreVersion
* @param moduleVersionState
*/
protected void setupModules(Version coreVersion, String moduleVersion) {
switch(coreVersion.getPreReleaseVersion()){
case "SNAPSHOT":
json.put("currentVersionState", UpgradeVersionState.DEVELOPMENT);
break;
default:
json.put("currentVersionState", UpgradeVersionState.PRODUCTION);
}
jsonModules.put("core", coreVersion.toString());
for(String module : modules) {
jsonModules.put(module, moduleVersion);
}
}
代码示例来源:origin: infiniteautomation/ma-core-public
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
ejt.update(DELETE_ALL);
for(Module m : ModuleRegistry.getModules())
ejt.doInsert(INSERT_MODULE, new Object[] { m.getName(), m.getVersion().toString() }, new int[] {Types.VARCHAR, Types.VARCHAR});
}
});
代码示例来源:origin: infiniteautomation/ma-core-public
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
ejt.update(DELETE_MODULE, new Object[] {module.getName()});
ejt.doInsert(INSERT_MODULE, new Object[] { module.getName(), module.getVersion().toString() }, new int[] {Types.VARCHAR, Types.VARCHAR});
}
});
代码示例来源:origin: com.redhat.red.build/kojiji
public Builder withNpmInfoAndType( NpmPackageRef ref )
{
target.outputType = StandardOutputType.npm.name();
target.extraInfo = new FileExtraInfo( new NpmExtraInfo( ref.getName(), ref.getVersion().toString() ) );
return this;
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-deployer-cloudfoundry
private RuntimeEnvironmentInfo runtimeEnvironmentInfo(Class spiClass, Class implementationClass) {
CloudFoundryClient client = connectionConfiguration.cloudFoundryClient(
connectionConfiguration.connectionContext(connectionConfiguration.cloudFoundryConnectionProperties()),
connectionConfiguration.tokenProvider(connectionConfiguration.cloudFoundryConnectionProperties()));
Version version = connectionConfiguration.version(client);
return new RuntimeEnvironmentInfo.Builder()
.implementationName(implementationClass.getSimpleName())
.spiClass(spiClass)
.implementationVersion(RuntimeVersionUtils.getVersion(CloudFoundryAppDeployer.class))
.platformType("Cloud Foundry")
.platformClientVersion(RuntimeVersionUtils.getVersion(client.getClass()))
.platformApiVersion(version.toString())
.platformHostVersion("unknown")
.addPlatformSpecificInfo("API Endpoint", connectionConfiguration.cloudFoundryConnectionProperties().getUrl().toString())
.build();
}
代码示例来源:origin: schaal/ocreader
@Test
public void testOutdatedVersion() throws IOException {
String originalVersion = dispatcher.version;
dispatcher.version = "8.8.0";
HttpUrl baseUrl = server.url("");
onView(withId(R.id.url)).perform(clearText(), typeText(baseUrl.toString()));
onView(withId(R.id.username)).perform(clearText(), typeText("admin"));
onView(withId(R.id.password)).perform(clearText(), typeText("admin"));
onView(withId(R.id.sign_in_button)).perform(scrollTo(), click());
onView(withId(R.id.url)).check(matches(hasErrorText(activityTestRule.getActivity().getString(R.string.error_insecure_connection))));
onView(withId(R.id.sign_in_button)).perform(scrollTo(), click());
onView(withId(R.id.status)).check(matches(withText(activityTestRule.getActivity().getString(R.string.ncnews_too_old, API.MIN_VERSION.toString()))));
dispatcher.version = originalVersion;
}
}
内容来源于网络,如有侵权,请联系作者删除!