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

com.messagebird.objects.conversations.ConversationMessageDirection Maven / Gradle / Ivy

Go to download

The MessageBird API provides a API to the MessageBird SMS and voicemail services located at https://www.messagebird.com.

The newest version!
package com.messagebird.objects.conversations;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Indicates the direction of a message.
 */
public enum ConversationMessageDirection {

    /**
     * Received is an in bound message received from a customer.
     */
    RECEIVED("received"),

    /**
     * Sent is an outbound message sent through the API.
     */
    SENT("sent");

    private final String direction;

    ConversationMessageDirection(final String direction) {
        this.direction = direction;
    }

    public String getDirection() {
        return direction;
    }

    @JsonCreator
    public static ConversationMessageDirection forValue(String value) {
        if ("received".equals(value)) {
            return ConversationMessageDirection.RECEIVED;
        } else if ("sent".equals(value)) {
            return ConversationMessageDirection.SENT;
        }

        return null;
    }

    @JsonValue
    public String toJson() {
        return getDirection();
    }

    @Override
    public String toString() {
        return getDirection();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy