code: public StringBuilder onWhereClause(StringBuilder builder, Class fieldClazz, String field, Object value,
              String clause, boolean useToken)
      {
  
          if (clause.trim().equals(IN_CLAUSE))
          {
              useToken = false;
          }
  
          builder = ensureCase(builder, field, useToken);
          builder.append(SPACE_STRING);
          if (fieldClazz.isAssignableFrom(List.class) || fieldClazz.isAssignableFrom(Map.class)
                  || fieldClazz.isAssignableFrom(Set.class))
          {
              builder.append("CONTAINS");
          }
          else
          {
              builder.append(clause);
          }
          builder.append(SPACE_STRING);
  
          if (clause.trim().equals(IN_CLAUSE))
          {
              builder.append(OPEN_BRACKET);
              String itemValues = String.valueOf(value);
              itemValues = itemValues.startsWith(OPEN_BRACKET) && itemValues.endsWith(CLOSE_BRACKET) ? itemValues
                      .substring(1, itemValues.length() - 1) : itemValues;
              List<String> items = Arrays.asList(((String) itemValues).split("\\s*,\\s*"));
              int counter = 0;
              for (String str : items)
              {
                  str = str.trim();
                  str = (str.startsWith(Constants.ESCAPE_QUOTE) && str.endsWith(Constants.ESCAPE_QUOTE))
                          || (str.startsWith("'") && str.endsWith("'")) ? str.substring(1, str.length() - 1) : str;
                  appendValue(builder, fieldClazz, str, false, false);
                  counter++;
                  if (counter < items.size())
                  {
                      builder.append(COMMA_STR);
                  }
  
              }
              builder.append(CLOSE_BRACKET);
          }
          else
          {
              appendValue(builder, fieldClazz, value, false, useToken);
          }
          return builder;
      }
docs: Build where clause with given clause.
  
  @param builder
  the builder
  @param fieldClazz
  the field clazz
  @param field
  the field
  @param value
  the value
  @param clause
  the clause
  @param useToken
  the use token
  @return the string builder