com.virjar.sekiro.api.databind.ICRCreateHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sekiro-api Show documentation
Show all versions of sekiro-api Show documentation
ratel api,used for developer on ratel system,an extension for xposed framewrok,ratel api compatable with original xposed framework
package com.virjar.sekiro.api.databind;
import com.virjar.sekiro.api.SekiroRequest;
import com.virjar.sekiro.api.SekiroRequestHandler;
import java.lang.reflect.Constructor;
/**
* Created by virjar on 2019/1/25.
* InvokeRequestConstructorActionRequestHandlerCreateHelper
*/
public class ICRCreateHelper implements ActionRequestHandlerGenerator {
private Constructor extends SekiroRequestHandler> theConstructor;
public ICRCreateHelper(Constructor extends SekiroRequestHandler> theConstructor) {
this.theConstructor = theConstructor;
}
@Override
public SekiroRequestHandler gen(SekiroRequest invokeRequest) {
try {
return theConstructor.newInstance(invokeRequest);
} catch (Exception e) {
// not happen
throw new IllegalStateException(e);
}
}
}