Here you can find the source of encode(final Object id)
static String encode(final Object id)
//package com.java2s; //License from project: Open Source License import java.net.URLEncoder; public class Main { static String encode(final Object id) { if (id instanceof String) return URLEncoder.encode(id.toString()); else//from ww w .jav a 2s .co m return id.toString(); } }