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

ru.whoisamyy.api.plugins.events.GetDailyLevelEvent Maven / Gradle / Ivy

There is a newer version: 0.0.4-release
Show newest version
package ru.whoisamyy.api.plugins.events;

import ru.whoisamyy.core.endpoints.RequestManager;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class GetDailyLevelEvent extends Event {
    @Override
    void init() {
        try {
            Method m = RequestManager.Levels.class.getMethod("getGJDailyLevel", Boolean.class);
            List> at = new ArrayList<>(List.of(m.getParameterTypes()));
            at.add(m.getReturnType());
            allowedTypes = at;
            Parameter[] params= m.getParameters();
            List strings = new ArrayList<>();
            Arrays.stream(params).forEach(x->strings.add(x.getName()));
            parameterNames = new ArrayList<>(strings);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException(e);
        }
    }

    public GetDailyLevelEvent(Object... parameterValues) throws NoSuchFieldException {
        super(parameterValues);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy