Package com.github.tadukoo.java
Class JavaCodeUtil
java.lang.Object
com.github.tadukoo.java.JavaCodeUtil
Utilities for dealing with Java code
- Version:
- Beta v.0.5
- Author:
- Logan Ferree (Tadukoo)
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringConverts the given Object to a String, including proper null handling.static StringescapeString(String theString) Escapes characters in the string for use in e.g.
-
Method Details
-
convertToJavaString
Converts the given Object to a String, including proper null handling. This will convert it to a String to be used in Java code, rather than mainly relying on the toString method.- Parameters:
obj- The Object to convert to a String- Returns:
- null if obj is null, or a String representing the Object
-
escapeString
Escapes characters in the string for use in e.g. builderCode so that you have \n instead of a newline- Parameters:
theString- The string to have characters escaped- Returns:
- The given String, but with the characters escaped
-