use of com.microsoft.azure.toolkit.lib.common.model.IArtifact in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfiguration method writeExternal.
@Override
public void writeExternal(Element element) throws WriteExternalException {
super.writeExternal(element);
final AzureArtifactManager manager = AzureArtifactManager.getInstance(this.getProject());
final Element appConfigElement = XmlSerializer.serialize(this.appConfig, (accessor, o) -> !"artifact".equalsIgnoreCase(accessor.getName()));
final IArtifact artifact = this.appConfig.getDeployment().getArtifact();
Optional.ofNullable(this.appConfig).map(config -> XmlSerializer.serialize(config, (accessor, o) -> !"artifact".equalsIgnoreCase(accessor.getName()))).ifPresent(element::addContent);
Optional.ofNullable(this.appConfig).map(config -> (WrappedAzureArtifact) config.getDeployment().getArtifact()).map((a) -> manager.getArtifactIdentifier(a.getArtifact())).map(id -> new Element("Artifact").setAttribute("identifier", id)).ifPresent(element::addContent);
}
Aggregations