package com.sequenceiq.cloudbreak.api.model; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; import com.sequenceiq.cloudbreak.common.type.RecipeType; import com.sequenceiq.cloudbreak.doc.ModelDescriptions; import com.sequenceiq.cloudbreak.doc.ModelDescriptions.RecipeModelDescription; import io.swagger.annotations.ApiModelProperty; public abstract class RecipeBase implements JsonEntity { @Size(max = 100, min = 1, message = "The length of the recipe's name has to be in range of 1 to 100") @Pattern(regexp = "([a-z][-a-z0-9]*[a-z0-9])", message = "The recipe's name can only contain lowercase alphanumeric characters and hyphens and has start with an alphanumeric character") @ApiModelProperty(value = ModelDescriptions.NAME) private String name; @Size(max = 1000) @ApiModelProperty(ModelDescriptions.DESCRIPTION) private String description; @NotNull @ApiModelProperty(value = RecipeModelDescription.TYPE) private RecipeType recipeType; @ApiModelProperty(value = RecipeModelDescription.CONTENT) private String content; @ApiModelProperty(value = RecipeModelDescription.RECIPE_URI) private String uri; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public RecipeType getRecipeType() { return recipeType; } public void setRecipeType(RecipeType recipeType) { this.recipeType = recipeType; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } }