Java URL Encode encode(final Object id)

Here you can find the source of encode(final Object id)

Description

encode

License

Open Source License

Declaration

static String encode(final Object id) 

Method Source Code

//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();
    }
}

Related

  1. encode(byte[] bytes, String encoding)
  2. encode(final String content, final String encoding)
  3. encode(final String raw)
  4. encode(final String s, final String enc)
  5. encode(final String string)