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

de.bytefish.fcmjava.requests.data.DataMulticastMessage 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.requests.data;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import de.bytefish.fcmjava.model.options.FcmMessageOptions;
import de.bytefish.fcmjava.requests.FcmMulticastMessage;
import de.bytefish.fcmjava.requests.notification.NotificationPayload;

import java.util.List;

public class DataMulticastMessage extends FcmMulticastMessage {

    private final Object data;
    private final NotificationPayload notification;

    public DataMulticastMessage(FcmMessageOptions options, List registratiodIds, Object data) {
        this(options, registratiodIds, data, null);
    }

    public DataMulticastMessage(FcmMessageOptions options, List registratiodIds, Object data, NotificationPayload notification) {
        super(options, registratiodIds);

        this.data = data;
        this.notification = notification;
    }

    @Override
    @JsonProperty("data")
    public Object getPayload() {
        return data;
    }

    @JsonProperty("notification")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public NotificationPayload getNotificationPayload() {
        return this.notification;
    }

}