Payload.java 5.68 KB
Newer Older
akbar fauzi's avatar
akbar fauzi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
package com.eksad.masterdata.domain;

import com.eksad.ddms.common.util.status.DataStatus;
import com.eksad.masterdata.common.listEnum.SourceType;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.*;

import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "TRX_PAYLOAD")
public class Payload {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "trx_payload_gen")
    @SequenceGenerator(name = "trx_payload_gen", sequenceName = "trx_payload_seq", allocationSize = 1)
    private Integer id;

    private String sourceId;

    private String type;

    @Column(name = "reqPayload", columnDefinition = "TEXT")
    private String reqPayload;

    @Column(name = "resPayload", columnDefinition = "TEXT")
    private String resPayload;

    private String event;

    @Temporal(TemporalType.DATE)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy", timezone = "Asia/Jakarta")
    private Date eventDate;

    @Enumerated(EnumType.STRING)
    private DataStatus payloadStatus;

    @Enumerated(EnumType.STRING)
    private SourceType sourceType;

    private String url;

    @Embedded
    private CreationalSpecification payloadCreational;

    public Payload() {
    }

    public Payload(Integer id, String sourceId, String type, String reqPayload, String resPayload, String event, Date eventDate, DataStatus payloadStatus, SourceType sourceType, String url, CreationalSpecification payloadCreational) {
        this.id = id;
        this.sourceId = sourceId;
        this.type = type;
        this.reqPayload = reqPayload;
        this.resPayload = resPayload;
        this.event = event;
        this.eventDate = eventDate;
        this.payloadStatus = payloadStatus;
        this.sourceType = sourceType;
        this.url = url;
        this.payloadCreational = payloadCreational;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public String getType() {
        return type;
    }

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

    public String getReqPayload() {
        return reqPayload;
    }

    public void setReqPayload(String reqPayload) {
        this.reqPayload = reqPayload;
    }

    public String getResPayload() {
        return resPayload;
    }

    public void setResPayload(String resPayload) {
        this.resPayload = resPayload;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public DataStatus getPayloadStatus() {
        return payloadStatus;
    }

    public void setPayloadStatus(DataStatus payloadStatus) {
        this.payloadStatus = payloadStatus;
    }

    public Date getEventDate() {
        return eventDate;
    }

    public void setEventDate(Date eventDate) {
        this.eventDate = eventDate;
    }

    public CreationalSpecification getPayloadCreational() {
        return payloadCreational;
    }

    public void setPayloadCreational(CreationalSpecification payloadCreational) {
        this.payloadCreational = payloadCreational;
    }

    public SourceType getSourceType() {
        return sourceType;
    }

    public void setSourceType(SourceType sourceType) {
        this.sourceType = sourceType;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + Objects.hashCode(this.id);
        hash = 89 * hash + Objects.hashCode(this.sourceId);
        hash = 89 * hash + Objects.hashCode(this.type);
        hash = 89 * hash + Objects.hashCode(this.reqPayload);
        hash = 89 * hash + Objects.hashCode(this.resPayload);
        hash = 89 * hash + Objects.hashCode(this.event);
        hash = 89 * hash + Objects.hashCode(this.eventDate);
        hash = 89 * hash + Objects.hashCode(this.payloadStatus);
        hash = 89 * hash + Objects.hashCode(this.sourceType);
        hash = 89 * hash + Objects.hashCode(this.url);
        hash = 89 * hash + Objects.hashCode(this.payloadCreational);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Payload other = (Payload) obj;
        if (!Objects.equals(this.sourceId, other.sourceId)) {
            return false;
        }
        if (!Objects.equals(this.type, other.type)) {
            return false;
        }
        if (!Objects.equals(this.reqPayload, other.reqPayload)) {
            return false;
        }
        if (!Objects.equals(this.resPayload, other.resPayload)) {
            return false;
        }
        if (!Objects.equals(this.event, other.event)) {
            return false;
        }
        if (!Objects.equals(this.eventDate, other.eventDate)) {
            return false;
        }
        if (!Objects.equals(this.payloadStatus, other.payloadStatus)) {
            return false;
        }
        if (!Objects.equals(this.sourceType, other.sourceType)) {
            return false;
        }
        if (!Objects.equals(this.payloadCreational, other.payloadCreational)) {
            return false;
        }
        if (!Objects.equals(this.id, other.id)) {
            return false;
        }
        if (!Objects.equals(this.url, other.url)) {
            return false;
        }
        return true;
    }
}