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

de.bytefish.fcmjava.responses.TopicMessageResponse Maven / Gradle / Ivy

There is a newer version: 2.5
Show newest version
// Copyright (c) Philipp Wagner. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package de.bytefish.fcmjava.responses;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.bytefish.fcmjava.model.enums.ErrorCodeEnum;

@JsonIgnoreProperties(ignoreUnknown = true)
public class TopicMessageResponse {

    private final long messageId;
    private final ErrorCodeEnum errorCode;

    @JsonCreator
    public TopicMessageResponse(
            @JsonProperty("message_id") long messageId,
            @JsonProperty("error") ErrorCodeEnum errorCode) {
        this.messageId = messageId;
        this.errorCode = errorCode;
    }

    public long getMessageId() {
        return messageId;
    }

    public ErrorCodeEnum getErrorCode() {
        return errorCode;
    }

    @Override
    public String toString() {
        return "TopicMessageResponse{" +
                "messageId=" + messageId +
                ", errorCode=" + errorCode +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy