bakuposter.gcm.server.Content.java Source code

Java tutorial

Introduction

Here is the source code for bakuposter.gcm.server.Content.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bakuposter.gcm.server;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.io.Serializable;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Rashad Javadov
 */
@JsonSerialize
public class Content implements Serializable {

    private List<String> registration_ids;
    private Map<String, String> data;

    public void addRegId(String regId) {
        if (registration_ids == null) {
            registration_ids = new LinkedList<String>();
        }
        registration_ids.add(regId);
    }

    public void createData(String title, String message) {
        if (data == null) {
            data = new HashMap<String, String>();
        }

        data.put("title", title);
        data.put("message", message);
    }

    public List<String> getRegistration_ids() {
        return registration_ids;
    }

    public void setRegistration_ids(List<String> registration_ids) {
        this.registration_ids = registration_ids;
    }

    public Map<String, String> getData() {
        return data;
    }

    public void setData(Map<String, String> data) {
        this.data = data;
    }

}