Java String Quote quoteIfString(Object obj)

Here you can find the source of quoteIfString(Object obj)

Description

quote If String

License

Apache License

Declaration

public static Object quoteIfString(Object obj) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static Object quoteIfString(Object obj) {
        return (obj instanceof String) ? quote((String) obj) : obj;
    }// w w  w  .j a v a  2 s .co  m

    public static String quote(String str) {
        return str != null ? "'" + str + "'" : null;
    }
}

Related

  1. quoteIfNeeded(String value)
  2. quoteIfNeeded(StringBuilder buf, String str, String delim)
  3. quoteIfNotNull(String str)
  4. quoteIfNotNull(String text)
  5. quoteIfNotNull(StringBuilder sb, String val)
  6. quoteIfString(Object obj)
  7. quoteIfString(Object... arguments)
  8. quoteImpl(String s, char delim)
  9. quoteIt(String orig)