com.huawei.openstack4j.openstack.artifact.domain.ToscaTemplates Maven / Gradle / Ivy
/*******************************************************************************
* Copyright 2016 ContainX and OpenStack4j
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*******************************************************************************/
package com.huawei.openstack4j.openstack.artifact.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huawei.openstack4j.model.artifact.Metadata;
import com.huawei.openstack4j.model.artifact.Template;
import com.huawei.openstack4j.model.artifact.ToscaTemplatesArtifact;
import com.huawei.openstack4j.model.artifact.builder.ToscaTemplatesArtifactBuilder;
import com.huawei.openstack4j.model.common.builder.BasicResourceBuilder;
import java.util.List;
/**
* A Glare Tosca Templates Artifact implementation model
*
* @author Pavan Vadavi
*/
public class ToscaTemplates extends ArtifactImpl implements ToscaTemplatesArtifact {
@JsonProperty("template_format")
private String templateFormat;
@JsonProperty("template")
private TemplateImpl template;
@Override
public TemplateImpl getTemplate() {
return template;
}
public void setTemplate(TemplateImpl template) {
this.template = template;
}
public String getTemplateFormat() {
return templateFormat;
}
public void setTemplateFormat(String templateFormat) {
this.templateFormat = templateFormat;
}
@Override
public ToscaTemplatesArtifactBuilder toBuilder() {
return new ToscaTemplatesConcreteBuilder(this);
}
public static ToscaTemplatesArtifactBuilder builder() {
return new ToscaTemplatesConcreteBuilder();
}
public static class ToscaTemplatesConcreteBuilder extends BasicResourceBuilder implements ToscaTemplatesArtifactBuilder {
private ToscaTemplates artifact;
ToscaTemplatesConcreteBuilder() {
this(new ToscaTemplates());
}
ToscaTemplatesConcreteBuilder(ToscaTemplates artifact) {
this.artifact = artifact;
}
@Override
public ToscaTemplatesArtifactBuilder template(Template template) {
artifact.template = (TemplateImpl) template;
return this;
}
@Override
public ToscaTemplatesArtifactBuilder templateFormat(String templateFormat) {
artifact.templateFormat = templateFormat;
return this;
}
@Override
public ToscaTemplatesArtifact build() {
return artifact;
}
@Override
public ToscaTemplatesArtifactBuilder from(ToscaTemplatesArtifact in) {
this.artifact = (ToscaTemplates) in;
return this;
}
@Override
public ToscaTemplatesArtifactBuilder description(String description) {
artifact.setDescription(description);
return this;
}
@Override
public ToscaTemplatesArtifactBuilder tags(List