Class Util

java.lang.Object
org.codehaus.mojo.servicedocgen.Util

public final class Util extends Object
Utility class with static helper methods.
Author:
hohwille
  • Method Details

    • getSimpleName

      public static String getSimpleName(String className)
      Parameters:
      className - a class name.
      Returns:
      the simple name.
    • toString

      public static String toString(Object value, String fallback)
      Parameters:
      value - the value to get as String. May be null.
      fallback - the fallback value.
      Returns:
      Object.toString() of value or fallback if value is null.
    • isEmpty

      public static boolean isEmpty(String value)
      Parameters:
      value - the String to check. May be null.
      Returns:
      true if the given String is empty or null, false otherwise.
    • appendPath

      public static String appendPath(String pathPrefix, String path)
      Parameters:
      pathPrefix - the base-bath.
      path - the path to append.
      Returns:
      the concatenation of both paths with an intermediate slash ("/") if needed.
    • getTrimmed

      public static String getTrimmed(String value)
      Parameters:
      value - the String to trim.
      Returns:
      the trimmed String or null if null was given.
    • containsSubstring

      public static boolean containsSubstring(Set<String> set, String substring)
      Parameters:
      set - a Set of Strings.
      substring - the substring to look for.
      Returns:
      true if the given Set contains a String that contains the given substring, false otherwise.