Class JavaCodeUtil

java.lang.Object
com.github.tadukoo.java.JavaCodeUtil

public class JavaCodeUtil extends Object
Utilities for dealing with Java code
Version:
Beta v.0.5
Author:
Logan Ferree (Tadukoo)
  • Method Details

    • convertToJavaString

      public static String convertToJavaString(Object obj)
      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

      public static String escapeString(String theString)
      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