public String toJSON()
  {
    Map<String,Object> parameters = new LinkedHashMap<String,Object>();
    parameters.put("id",Integer.valueOf(getId()));
    if (GoCoin.hasValue(getName()))
    {
      parameters.put("name",getName());
    }
    if (GoCoin.hasValue(getUid()))
    {
      parameters.put("uid",getUid());
    }
    if (GoCoin.hasValue(getSecret()))
    {
      parameters.put("secret",getSecret());
    }
    if (GoCoin.hasValue(getRedirectUri()))
    {
      parameters.put("redirect_uri",getRedirectUri());
    }
    if (GoCoin.hasValue(getOwnerId()))
    {
      parameters.put("owner_id",getOwnerId());
    }
    if (GoCoin.hasValue(getOwnerType()))
    {
      parameters.put("owner_type",getOwnerType());
    }
    parameters.put("protected",String.valueOf(getProtectedFlag()));
    parameters.put("allow_grant_type_password",String.valueOf(getAllowGrantTypePassword()));
    parameters.put("allow_grant_type_authorization_code",String.valueOf(getAllowGrantTypeAuthCode()));
    parameters.put("allow_grant_type_client_credentials",String.valueOf(getAllowGrantTypeClientCredentials()));
    parameters.put("allow_grant_type_implicit",String.valueOf(getAllowGrantTypeImplicit()));

    return GoCoin.toJSON(parameters);
  }