state.addProperty(CURRENT_VERSION, targetObject.getCurrentVersion());
state.addProperty(IS_REGISTERED, Boolean.toString(targetObject.isRegistered()));
state.addProperty(NEEDS_APPROVAL, Boolean.toString(targetObject.needsApprove()));
state.addProperty(AUTO_APPROVE, Boolean.toString(targetObject.getAutoApprove()));
JsonArray artifactsFromShop = new JsonArray();
ArtifactObject[] artifactObjects = targetObject.getArtifactsFromShop();
if (artifactObjects != null) {
for (ArtifactObject a : artifactObjects) {
artifactsFromShop.add(new JsonPrimitive(a.getDefinition()));
}
}
state.add(ARTIFACTS_FROM_SHOP, artifactsFromShop);
JsonArray artifactsFromDeployment = new JsonArray();
DeploymentArtifact[] deploymentArtifacts = targetObject.getArtifactsFromDeployment();
if (deploymentArtifacts != null) {
for (DeploymentArtifact a : deploymentArtifacts) {
artifactsFromDeployment.add(new JsonPrimitive(a.getUrl()));
}
}
state.add(ARTIFACTS_FROM_DEPLOYMENT, artifactsFromDeployment);
state.addProperty(LAST_INSTALL_VERSION, targetObject.getLastInstallVersion());