Last active
March 27, 2022 01:00
-
-
Save h1ddengames/e9453ceeb118b47ebe17b588d28d0226 to your computer and use it in GitHub Desktop.
Java File and Code Templates for IntelliJ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Purpose: What does this class do? | |
* | |
* @version 1.0 | |
* @since ${DATE} - ${TIME} | |
* @author Shahid Karim | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
#parse("File Header.java") | |
public class ${NAME} { | |
// ~@Variables | |
// ~@Constructors | |
// ~@Getters/Setters | |
// ~@Methods | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import java.util.Arrays; | |
import java.util.Optional; | |
#parse("File Header.java") | |
public enum ${NAME} { | |
TYPE("T"); | |
private final String value; | |
${NAME}(String value) { | |
this.value = value; | |
} | |
public static Optional<${NAME}> convertToEnum(String value) { | |
return Arrays.stream(${NAME}.values()) | |
.filter(currentEnumElement -> currentEnumElement.value.equals(value)) | |
.findFirst(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
#parse("File Header.java") | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.FIELD) | |
public @interface ${NAME} { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end | |
import org.junit.jupiter.api.Test; | |
#parse("File Header.java") | |
public class ${NAME} { | |
@Test | |
public void test() { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment