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

com.digitaldan.harmony.messages.GetCurrentActivityMessage Maven / Gradle / Ivy

package com.digitaldan.harmony.messages;

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

import com.google.gson.annotations.SerializedName;

public class GetCurrentActivityMessage {

    public static final String MIME_TYPE = "vnd.logitech.harmony/vnd.logitech.harmony.engine?getCurrentActivity";

    public static class GetCurrentActivityRequestMessage extends RequestMessage {

        HashMap params = new HashMap<>();

        public GetCurrentActivityRequestMessage() {
            super(MIME_TYPE);
        }

        @Override
        public Map getParams() {
            return params;
        }

    }

    public static class GetCurrentActivityResponseMessage extends ResponseMessage {

        @SerializedName("data")
        private CurrentActivityResult currentActivityResult;

        public GetCurrentActivityResponseMessage(int code, String id, String msg) {
            super(code, id, msg);
        }

        public int getActivityId() {
            try {
                return Integer.parseInt(currentActivityResult.result);
            } catch (Exception e) {
                return -1;
            }
        }

        private class CurrentActivityResult {
            private String result;

        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy