@Test public void testSingleQuote() { assertNull(PEStringUtils.singleQuote(null)); assertEquals("", PEStringUtils.singleQuote("")); assertEquals("'Hello, World!'", PEStringUtils.singleQuote("Hello, World!")); assertEquals("'Hello, World!'", PEStringUtils.singleQuote("'Hello, World!'")); assertEquals("'`Hello, World!`'", PEStringUtils.singleQuote("`Hello, World!`")); assertEquals("''Hello, World!`'", PEStringUtils.singleQuote("'Hello, World!`")); }
public static String singleQuote(final String value) { if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) { return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE); } return value; }
PEStringUtils { public static String singleQuote(final String value) { if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) { return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE); } return value; } }
PEStringUtils { public static String singleQuote(final String value) { if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) { return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE); } return value; } private  PEStringUtils(); }
PEStringUtils { public static String singleQuote(final String value) { if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) { return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE); } return value; } private  PEStringUtils(); static String buildPath(String dir, String sep, String name); static StringBuffer toString(StringBuffer sb, String name, Collection<? extends Object> values); static StringBuffer toArrayString(StringBuffer sb, Collection<? extends Object> values); static String toString(String name, Collection<? extends Object> values); static String toString(Class<T> theClass, Collection<? extends Object> values); static StringBuffer toString(StringBuffer sb, String name, Map<K, V> values); static String toString(String name, Map<K, V> values); static String[] toArray(Collection<String> values); static String trimToInt(final String numeric); static String normalizePrefix(String prefix); static String toString(Throwable e); static Pattern buildSQLPattern(String likeExpr); static String singleQuote(final String value); static boolean isQuoted(final String value); static String dequote(final String in); static String escapeSingleQuoteIfNecessary(String t); static boolean toBoolean(String value); static boolean isHexNumber(final String value); static String getIndented(final String value); static String getIndented(final String value, final int numIndents); static String getIndented(final String value, final String indent, final int numIndents); static String buildIndent(final int numIndents); static String buildIndent(final String indent, final int numIndents); }
PEStringUtils { public static String singleQuote(final String value) { if ((value != null) && !value.isEmpty() && !isQuoted(value, SINGLE_QUOTE)) { return SINGLE_QUOTE.concat(value).concat(SINGLE_QUOTE); } return value; } private  PEStringUtils(); static String buildPath(String dir, String sep, String name); static StringBuffer toString(StringBuffer sb, String name, Collection<? extends Object> values); static StringBuffer toArrayString(StringBuffer sb, Collection<? extends Object> values); static String toString(String name, Collection<? extends Object> values); static String toString(Class<T> theClass, Collection<? extends Object> values); static StringBuffer toString(StringBuffer sb, String name, Map<K, V> values); static String toString(String name, Map<K, V> values); static String[] toArray(Collection<String> values); static String trimToInt(final String numeric); static String normalizePrefix(String prefix); static String toString(Throwable e); static Pattern buildSQLPattern(String likeExpr); static String singleQuote(final String value); static boolean isQuoted(final String value); static String dequote(final String in); static String escapeSingleQuoteIfNecessary(String t); static boolean toBoolean(String value); static boolean isHexNumber(final String value); static String getIndented(final String value); static String getIndented(final String value, final int numIndents); static String getIndented(final String value, final String indent, final int numIndents); static String buildIndent(final int numIndents); static String buildIndent(final String indent, final int numIndents); static final String FILE_SEP; }