package com.r11.tools.model;

import com.r11.tools.model.constraints.HttpCode;
import java.io.Serializable;
import java.util.Map;
import java.util.UUID;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import lombok.*;

/**
 * Alternative version of {@link MockedMessage} used in http body
 * @author Rafał Żukowicz
 * @author Gabriel Modzelewski
 */
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
public class MockedMessageDto implements Serializable, Comparable<MockedMessageDto> {
    private UUID clientUUID;
    @NotNull
    @Positive
    private Integer mockedResponseId;
    private String mediaType;
    private String messageBody;
    private Map<String, String> httpHeaders;
    @HttpCode
    private Integer httpStatus;

    @Override
    public int compareTo(MockedMessageDto message) {
        return this.mockedResponseId > message.getMockedResponseId() ? 1 : -1;
    }
}
