[New] Added constants for VersionQueryResult
This commit is contained in:
parent
74a649d2d7
commit
fc1ec3b5a3
|
@ -24,7 +24,7 @@ import com.google.gson.JsonObject;
|
||||||
*/
|
*/
|
||||||
public class ComponentVersion extends StrolchVersion {
|
public class ComponentVersion extends StrolchVersion {
|
||||||
|
|
||||||
private static final String COMPONENT_VERSION = "componentName";
|
public static final String COMPONENT_VERSION = "componentName";
|
||||||
|
|
||||||
private String componentName;
|
private String componentName;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
|
* Copyright 2013 Robert von Burg <eitch@eitchnet.ch>
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -15,6 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package li.strolch.agent.api;
|
package li.strolch.agent.api;
|
||||||
|
|
||||||
|
import static li.strolch.model.Tags.Json.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -84,17 +86,17 @@ public class VersionQueryResult {
|
||||||
public JsonObject toJson() {
|
public JsonObject toJson() {
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
|
|
||||||
jsonObject.add("appVersion", this.appVersion.toJson());
|
jsonObject.add(APP_VERSION, this.appVersion.toJson());
|
||||||
jsonObject.add("agentVersion", this.agentVersion.toJson());
|
jsonObject.add(AGENT_VERSION, this.agentVersion.toJson());
|
||||||
|
|
||||||
JsonArray componentVersionsJ = new JsonArray();
|
JsonArray componentVersionsJ = new JsonArray();
|
||||||
this.componentVersions.forEach(c -> componentVersionsJ.add(c.toJson()));
|
this.componentVersions.forEach(c -> componentVersionsJ.add(c.toJson()));
|
||||||
jsonObject.add("componentVersions", componentVersionsJ);
|
jsonObject.add(COMPONENT_VERSIONS, componentVersionsJ);
|
||||||
|
|
||||||
if (this.errors != null) {
|
if (this.errors != null) {
|
||||||
JsonArray errorsJ = new JsonArray();
|
JsonArray errorsJ = new JsonArray();
|
||||||
this.errors.forEach(errorsJ::add);
|
this.errors.forEach(errorsJ::add);
|
||||||
jsonObject.add("errors", errorsJ);
|
jsonObject.add(ERRORS, errorsJ);
|
||||||
}
|
}
|
||||||
|
|
||||||
return jsonObject;
|
return jsonObject;
|
||||||
|
|
|
@ -145,6 +145,11 @@ public class Tags {
|
||||||
public static final String EXCEPTION = "exception";
|
public static final String EXCEPTION = "exception";
|
||||||
public static final String FORMAT = "format";
|
public static final String FORMAT = "format";
|
||||||
public static final String FLAT = "flat";
|
public static final String FLAT = "flat";
|
||||||
|
|
||||||
|
public static final String APP_VERSION = "appVersion";
|
||||||
|
public static final String AGENT_VERSION = "agentVersion";
|
||||||
|
public static final String COMPONENT_VERSIONS = "componentVersions";
|
||||||
|
public static final String ERRORS = "errors";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Audit {
|
public static class Audit {
|
||||||
|
|
Loading…
Reference in New Issue