Effect: You
will see that I have one more ThreadClass template here. Let’s
create this template.
File | Settings | Editor | File and Code Templates.
Here I choose project. You can also choose default. This template here is just in It is often used in the current project, so I chose the project scope here
and copy the code below to the right side of the figure.
#if (${
PACKAGE_NAME} && ${
PACKAGE_NAME} != "")
package ${
PACKAGE_NAME}; // 解决package
#end
#parse("File Header.java")
import lombok.extern.slf4j.Slf4j;
import static com.rh.bilibili.utils.Sleeper.sleep;
/**
* @Title: ${NAME}
* @Description:
* @author:pzj
* @date: ${DATE} ${TIME}
*/
@Slf4j(topic = "c.${NAME}")
public class ${
NAME} {
public static void main(String[] args) {
new Thread(()->{
},"t1").start();
}
}
After completing the above preparations, when you right-click to create a new Java Class, our own commonly used templates will appear.
Reference: https://www.cnblogs.com/jason0529/p/13606595.html