All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.activiti.cloud.modeling.api.impl.ModelImpl Maven / Gradle / Ivy

/*
 * Copyright 2018 Alfresco, Inc. and/or its affiliates.
 *
 * 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 org.activiti.cloud.modeling.api.impl;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.activiti.cloud.modeling.api.process.Extensions;
import org.activiti.cloud.modeling.api.Model;
import org.activiti.cloud.services.auditable.AbstractAuditable;

import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;

import java.util.Map;

/**
 * Implementation for {@link Model}
 */
@ApiModel("Model")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(NON_NULL)
public class ModelImpl extends AbstractAuditable implements Model {

    @ApiModelProperty(readOnly = true)
    private String id;

    @ApiModelProperty("The name of the model")
    private String name;

    @ApiModelProperty(value = "The type of the model", readOnly = true)
    private String type;

    @ApiModelProperty(value = "The version of the model", readOnly = true)
    private String version;

    @ApiModelProperty(value = "The content type of the model", readOnly = true, hidden = true)
    private String contentType;

    @ApiModelProperty(value = "The content of the model", readOnly = true, hidden = true)
    private byte[] content;

    @ApiModelProperty(hidden = true)
    @JsonIgnore
    private ProjectImpl project;

    @ApiModelProperty("The parent project id")
    private String projectId;

    @ApiModelProperty(value = "The extensions of the model", readOnly = true)
    private Map extensions;

    @ApiModelProperty(value = "The template of the model", readOnly = true)
    private String template;

    public ModelImpl() {

    }

    public ModelImpl(String id,
                     String name,
                     String type) {
        this.id = id;
        this.name = name;
        this.type = type;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public void setType(String type) {
        this.type = type;
    }

    @Override
    public ProjectImpl getProject() {
        return project;
    }

    public String getProjectId() {
        return projectId;
    }

    @Override
    public void setProject(ProjectImpl project) {
        this.project = project;
        this.projectId = project.getId();
    }

    @Override
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public String getContentType() {
        return contentType;
    }

    @Override
    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    @Override
    public byte[] getContent() {
        return content;
    }

    @Override
    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public Map getExtensions() {
        return extensions;
    }

    @Override
    public void setExtensions(Map extensions) {
        this.extensions = extensions;
    }

    @Override
    public String getTemplate() {
        return template;
    }

    @Override
    public void setTemplate(String template) {
        this.template = template;
    }

    @Override
    public String toString() {
        return type + " MODEL [" + id + ", " + name + "]";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy