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

weiboclient4j.params.InboxType Maven / Gradle / Ivy

The newest version!
package weiboclient4j.params;

import weiboclient4j.StatusService;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Hover Ruan
 */
public enum InboxType implements
        StatusService.QueryIdParam,
        StatusService.QueryIdListParam {

    Outbox(0), Inbox(1);

    private static Map map = new HashMap();

    static {
        for (InboxType inboxType : InboxType.values()) {
            map.put(inboxType.getValue(), inboxType);
        }
    }

    private int value;

    InboxType(int value) {
        this.value = value;
    }

    public static InboxType fromValue(int value) {
        return map.get(value);
    }

    public int getValue() {
        return value;
    }

    public void addParameter(Parameters params) {
        if (this != Outbox) {
            params.add("inbox", getValue());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy