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

com.urbanairship.api.push.model.notification.actions.AppDefinedAction Maven / Gradle / Ivy

There is a newer version: 9.4.2
Show newest version
/*
 * Copyright (c) 2013-2016.  Urban Airship and Contributors
 */

package com.urbanairship.api.push.model.notification.actions;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.urbanairship.api.push.model.PushModelObject;

public final class AppDefinedAction extends PushModelObject implements Action {

    private final ObjectNode payload;

    public AppDefinedAction(ObjectNode payload) {
        Preconditions.checkNotNull(payload, "'payload' cannot be null.");
        this.payload = payload;
    }

    @Override
    public ObjectNode getValue() {
        return payload;
    }

    @Override
    public ActionType getActionType() {
        return ActionType.APP_DEFINED;
    }

    @Override
    public String toString() {
        return "AppDefinedAction{" +
                "payload=" + payload +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(payload);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        final AppDefinedAction other = (AppDefinedAction) obj;
        return Objects.equal(this.payload, other.payload);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy