package riomhaire.lti.core.model;

import java.util.Map;

public class LTIMessage {
    private String messageType;
    private Map<String, Object> metadata;
    private Map<String, String> queryParams;
    private Map<String, Object> claims;

    LTIMessage(String messageType, Map<String, Object> metadata, Map<String, String> queryParams, Map<String, Object> claims) {
        this.messageType = messageType;
        this.metadata = metadata;
        this.queryParams = queryParams;
        this.claims = claims;
    }

    public static LTIMessageBuilder builder() {
        return new LTIMessageBuilder();
    }

    public String getMessageType() {
        return this.messageType;
    }

    public Map<String, Object> getMetadata() {
        return this.metadata;
    }

    public Map<String, String> getQueryParams() {
        return this.queryParams;
    }

    public Map<String, Object> getClaims() {
        return this.claims;
    }

    public void setMessageType(String messageType) {
        this.messageType = messageType;
    }

    public void setMetadata(Map<String, Object> metadata) {
        this.metadata = metadata;
    }

    public void setQueryParams(Map<String, String> queryParams) {
        this.queryParams = queryParams;
    }

    public void setClaims(Map<String, Object> claims) {
        this.claims = claims;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof LTIMessage)) return false;
        final LTIMessage other = (LTIMessage) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$messageType = this.getMessageType();
        final Object other$messageType = other.getMessageType();
        if (this$messageType == null ? other$messageType != null : !this$messageType.equals(other$messageType))
            return false;
        final Object this$metadata = this.getMetadata();
        final Object other$metadata = other.getMetadata();
        if (this$metadata == null ? other$metadata != null : !this$metadata.equals(other$metadata)) return false;
        final Object this$queryParams = this.getQueryParams();
        final Object other$queryParams = other.getQueryParams();
        if (this$queryParams == null ? other$queryParams != null : !this$queryParams.equals(other$queryParams))
            return false;
        final Object this$claims = this.getClaims();
        final Object other$claims = other.getClaims();
        if (this$claims == null ? other$claims != null : !this$claims.equals(other$claims)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof LTIMessage;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $messageType = this.getMessageType();
        result = result * PRIME + ($messageType == null ? 43 : $messageType.hashCode());
        final Object $metadata = this.getMetadata();
        result = result * PRIME + ($metadata == null ? 43 : $metadata.hashCode());
        final Object $queryParams = this.getQueryParams();
        result = result * PRIME + ($queryParams == null ? 43 : $queryParams.hashCode());
        final Object $claims = this.getClaims();
        result = result * PRIME + ($claims == null ? 43 : $claims.hashCode());
        return result;
    }

    public String toString() {
        return "LTIMessage(messageType=" + this.getMessageType() + ", metadata=" + this.getMetadata() + ", queryParams=" + this.getQueryParams() + ", claims=" + this.getClaims() + ")";
    }

    public static class LTIMessageBuilder {
        private String messageType;
        private Map<String, Object> metadata;
        private Map<String, String> queryParams;
        private Map<String, Object> claims;

        LTIMessageBuilder() {
        }

        public LTIMessageBuilder messageType(String messageType) {
            this.messageType = messageType;
            return this;
        }

        public LTIMessageBuilder metadata(Map<String, Object> metadata) {
            this.metadata = metadata;
            return this;
        }

        public LTIMessageBuilder queryParams(Map<String, String> queryParams) {
            this.queryParams = queryParams;
            return this;
        }

        public LTIMessageBuilder claims(Map<String, Object> claims) {
            this.claims = claims;
            return this;
        }

        public LTIMessage build() {
            return new LTIMessage(messageType, metadata, queryParams, claims);
        }

        public String toString() {
            return "LTIMessage.LTIMessageBuilder(messageType=" + this.messageType + ", metadata=" + this.metadata + ", queryParams=" + this.queryParams + ", claims=" + this.claims + ")";
        }
    }
}
