generated from dxfeng/secondev-chapanda-feishu
38 lines
910 B
Java
38 lines
910 B
Java
|
|
package com.engine.recruit.factory;
|
||
|
|
|
||
|
|
import com.engine.core.impl.Service;
|
||
|
|
import com.engine.recruit.service.RecruitButtonService;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <p>聚才林招聘</p>
|
||
|
|
* 招聘按钮工厂类
|
||
|
|
*
|
||
|
|
* @author:dxfeng
|
||
|
|
* @createTime: 2023/09/18
|
||
|
|
* @version: 1.0
|
||
|
|
*/
|
||
|
|
public class RecruitButtonFactory {
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 根据类的全路径获取类对象
|
||
|
|
*
|
||
|
|
* @param className 类全路径
|
||
|
|
* @param <T>
|
||
|
|
* @return
|
||
|
|
*/
|
||
|
|
public static <T extends Service> Class<T> getClass(String className) {
|
||
|
|
Class<?> clazz;
|
||
|
|
try {
|
||
|
|
clazz = Class.forName(className);
|
||
|
|
if (!RecruitButtonService.class.isAssignableFrom(clazz)) {
|
||
|
|
throw new IllegalArgumentException("该类未实现RecruitButtonService");
|
||
|
|
}
|
||
|
|
return (Class<T>) clazz;
|
||
|
|
} catch (ClassNotFoundException e) {
|
||
|
|
throw new RuntimeException(e);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|