package com.nokia.sms.pojo;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.concurrent.LinkedBlockingQueue;

@NoArgsConstructor
@Data
public class SmsReport {
    static final LinkedBlockingQueue<SmsReport> QUEUE = new LinkedBlockingQueue<>();
    private String id;
    private String phone;
    private String flowId;
    private Date sendTime;
    private Date reportTime;
    private Integer reportType;
    private Integer state;
    private Integer errorCode;

    public static boolean offer(SmsReport report) {
        return QUEUE.offer(report);
    }

    public static SmsReport take() throws InterruptedException {
        return QUEUE.take();
    }
}
