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

net.n2oapp.framework.api.ui.ResponseMessage Maven / Gradle / Ivy

There is a newer version: 7.28.1
Show newest version
package net.n2oapp.framework.api.ui;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
import net.n2oapp.framework.api.exception.SeverityType;
import net.n2oapp.framework.api.metadata.Compiled;
import net.n2oapp.framework.api.metadata.meta.widget.MessagePlacement;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * Стандартное сообщение N2O
 */
@Getter
@Setter
public class ResponseMessage implements Compiled {
    @JsonProperty
    private String id;
    @JsonProperty
    private String field;
    @JsonProperty
    private String title;
    @JsonProperty
    private String severity;
    @JsonProperty
    private String className;
    @JsonProperty
    private String text;
    @JsonProperty
    private Integer timeout;
    @JsonProperty
    private Boolean closeButton = true;
    @JsonProperty
    private String href;
    @JsonProperty
    private String modelLink;
    @JsonProperty
    private MessagePlacement placement;
    @JsonProperty
    private Map style;
    @JsonProperty("stacktrace")
    private List payload;
    @JsonProperty
    private LocalDateTime time;

    @JsonProperty
    public String getId() {
        return UUID.randomUUID().toString();
    }

    public void setSeverityType(SeverityType severity) {
        this.severity = severity != null ? severity.getId() : null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy