net.oauth.OAuth.toString()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中net.oauth.OAuth.toString()方法的一些代码示例,展示了OAuth.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OAuth.toString()方法的具体详情如下:
包路径:net.oauth.OAuth
类名称:OAuth
方法名:toString

OAuth.toString介绍

暂无

代码示例

代码示例来源:origin: net.oauth.core/oauth

/**
 * Construct a Map containing a copy of the given parameters. If several
 * parameters have the same name, the Map will contain the first value,
 * only.
 */
public static Map<String, String> newMap(Iterable<? extends Map.Entry> from) {
  Map<String, String> map = new HashMap<String, String>();
  if (from != null) {
    for (Map.Entry f : from) {
      String key = toString(f.getKey());
      if (!map.containsKey(key)) {
        map.put(key, toString(f.getValue()));
      }
    }
  }
  return map;
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Construct a Map containing a copy of the given parameters. If several
 * parameters have the same name, the Map will contain the first value,
 * only.
 */
@SuppressWarnings("rawtypes")
public static Map<String, String> newMap(Iterable<? extends Map.Entry> from) {
  Map<String, String> map = new HashMap<String, String>();
  if (from != null) {
    for (Map.Entry f : from) {
      String key = toString(f.getKey());
      if (!map.containsKey(key)) {
        map.put(key, toString(f.getValue()));
      }
    }
  }
  return map;
}

代码示例来源:origin: sakaiproject/sakai

/** Construct a &-separated list of the given values, percentEncoded. */
public static String percentEncode(Iterable<?> values) {
  StringBuilder p = new StringBuilder();
  for (Object v : values) {
    if (p.length() > 0) {
      p.append("&");
    }
    p.append(OAuth.percentEncode(toString(v)));
  }
  return p.toString();
}

代码示例来源:origin: net.oauth.core/oauth

/** Construct a &-separated list of the given values, percentEncoded. */
public static String percentEncode(Iterable values) {
  StringBuilder p = new StringBuilder();
  for (Object v : values) {
    if (p.length() > 0) {
      p.append("&");
    }
    p.append(OAuth.percentEncode(toString(v)));
  }
  return p.toString();
}

代码示例来源:origin: sakaiproject/sakai

/**
 * Write a form-urlencoded document into the given stream, containing the
 * given sequence of name/value pairs.
 */
@SuppressWarnings("rawtypes")
public static void formEncode(Iterable<? extends Map.Entry> parameters,
    OutputStream into) throws IOException {
  if (parameters != null) {
    boolean first = true;
    for (Map.Entry parameter : parameters) {
      if (first) {
        first = false;
      } else {
        into.write('&');
      }
      into.write(percentEncode(toString(parameter.getKey()))
          .getBytes());
      into.write('=');
      into.write(percentEncode(toString(parameter.getValue()))
          .getBytes());
    }
  }
}

代码示例来源:origin: net.oauth.core/oauth

/**
 * Write a form-urlencoded document into the given stream, containing the
 * given sequence of name/value pairs.
 */
public static void formEncode(Iterable<? extends Map.Entry> parameters,
    OutputStream into) throws IOException {
  if (parameters != null) {
    boolean first = true;
    for (Map.Entry parameter : parameters) {
      if (first) {
        first = false;
      } else {
        into.write('&');
      }
      into.write(encodeCharacters(percentEncode(toString(parameter.getKey()))));
      into.write('=');
      into.write(encodeCharacters(percentEncode(toString(parameter.getValue()))));
    }
  }
}

相关文章