package com.sequenceiq.cloudbreak.api.model; import java.util.HashMap; import java.util.Map; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.sequenceiq.cloudbreak.doc.ModelDescriptions; import io.swagger.annotations.ApiModelProperty; @JsonIgnoreProperties(ignoreUnknown = true) public abstract class TemplateBase implements JsonEntity { @NotNull @ApiModelProperty(value = ModelDescriptions.CLOUD_PLATFORM, required = true) private String cloudPlatform; @Size(max = 100, min = 5, message = "The length of the template's name has to be in range of 5 to 100") @Pattern(regexp = "([a-z][-a-z0-9]*[a-z0-9])", message = "The name of the template can only contain lowercase alphanumeric characters and hyphens and has start with an alphanumeric character") @NotNull @ApiModelProperty(value = ModelDescriptions.NAME, required = true) private String name; @ApiModelProperty(value = ModelDescriptions.TemplateModelDescription.PARAMETERS) private Map<String, Object> parameters = new HashMap<>(); @Size(max = 1000) @ApiModelProperty(ModelDescriptions.DESCRIPTION) private String description; @ApiModelProperty(ModelDescriptions.TemplateModelDescription.VOLUME_TYPE) private String volumeType; @NotNull @ApiModelProperty(value = ModelDescriptions.TemplateModelDescription.INSTANCE_TYPE, required = true) private String instanceType; @ApiModelProperty(ModelDescriptions.TOPOLOGY_ID) private Long topologyId; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getCloudPlatform() { return cloudPlatform; } public void setCloudPlatform(String type) { this.cloudPlatform = type; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Map<String, Object> getParameters() { return parameters; } public void setParameters(Map<String, Object> parameters) { this.parameters = parameters; } public String getVolumeType() { return volumeType; } public void setVolumeType(String volumeType) { this.volumeType = volumeType; } public String getInstanceType() { return instanceType; } public void setInstanceType(String instanceType) { this.instanceType = instanceType; } public Long getTopologyId() { return topologyId; } public void setTopologyId(Long topologyId) { this.topologyId = topologyId; } }