/*
 * Decompiled with CFR 0.152.
 *
 * Could not load the following classes:
 *  cn.hutool.core.util.ObjectUtil
 *  org.springframework.stereotype.Component
 */
package org.jeecg.common.modules.redis.receiver;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.spring.SpringUtil;
import org.jeecg.common.base.BaseMap;
import org.jeecg.common.modules.redis.listener.JeecgRedisListener;
import org.springframework.stereotype.Component;

@Component
public class RedisReceiver {

    public void onMessage(BaseMap params) {
        Object handlerName = params.get("handlerName");
        JeecgRedisListener messageListener = SpringUtil.getBean(handlerName.toString(), JeecgRedisListener.class);
        if (ObjectUtil.isNotEmpty(messageListener)) {
            messageListener.onMessage(params);
        }
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof RedisReceiver)) {
            return false;
        }
        RedisReceiver other = (RedisReceiver) o;
        return other.canEqual(this);
    }

    protected boolean canEqual(Object other) {
        return other instanceof RedisReceiver;
    }

    public int hashCode() {
        boolean result = true;
        return 1;
    }

    public String toString() {
        return "RedisReceiver()";
    }
}