Skip to content

Instantly share code, notes, and snippets.

@hisetu
Last active November 29, 2016 10:12
Show Gist options
  • Save hisetu/256460b23e27dd8da6265155d31343aa to your computer and use it in GitHub Desktop.
Save hisetu/256460b23e27dd8da6265155d31343aa to your computer and use it in GitHub Desktop.
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME}{
private static volatile ${NAME} INSTANCE;
public static ${NAME} getInstance() {
if (INSTANCE == null) {
synchronized (${NAME}.class) {
if (INSTANCE == null) {
INSTANCE = new ${NAME}();
}
}
}
return INSTANCE;
}
public static void destroyInstance(){
INSTANCE = null;
}
private ${NAME}() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment