Skip to content

Instantly share code, notes, and snippets.

@taichi
Created November 14, 2015 00:21
Show Gist options
  • Save taichi/963d031f32679fd75b38 to your computer and use it in GitHub Desktop.
Save taichi/963d031f32679fd75b38 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
String[] tmpl = { //
"public void %s(CharSequence msg) {this.delegate.printMessage(Kind.%s, msg, null);}",
"public void %s(Supplier<CharSequence> msg) {this.delegate.printMessage(Kind.%s, msg.get(), null);}",
"public void %s(CharSequence msg,Element e) {this.delegate.printMessage(Kind.%s, msg, e);}",
"public void %s(Supplier<CharSequence> msg,Element e) {this.delegate.printMessage(Kind.%s, msg.get(), e);}",
"public void %s(CharSequence msg,Element e,AnnotationMirror a) {this.delegate.printMessage(Kind.%s, msg, e, a);}",
"public void %s(Supplier<CharSequence> msg,Element e,AnnotationMirror a) {this.delegate.printMessage(Kind.%s, msg.get(), e, a);}",
"public void %s(CharSequence msg,Element e,AnnotationMirror a,AnnotationValue v) {this.delegate.printMessage(Kind.%s, msg, e, a, v);}",
"public void %s(Supplier<CharSequence> msg,Element e,AnnotationMirror a,AnnotationValue v) {this.delegate.printMessage(Kind.%s, msg.get(), e, a, v);}",//
};
String[][] vals = { { "debug", "OTHER" }, { "info", "NOTE" }, { "warn", "WARNING" }, { "error", "ERROR" }, };
for (String[] v : vals)
{
for (String t : tmpl) {
System.out.printf(t, v[0], v[1]);
System.out.println();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment