org.apache.dubbo.common.URL.getParameters()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(72)

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

URL.getParameters介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
public Map<String, String> getParameters() {
  return super.getParameters();
}

代码示例来源:origin: apache/incubator-dubbo

private static String[] getFilteredKeys(URL url) {
  Map<String, String> params = url.getParameters();
  if (CollectionUtils.isNotEmptyMap(params)) {
    return params.keySet().stream()
        .filter(k -> k.startsWith(HIDE_KEY_PREFIX))
        .toArray(String[]::new);
  } else {
    return new String[0];
  }
}

代码示例来源:origin: apache/incubator-dubbo

public URL setAddress(String address) {
  int i = address.lastIndexOf(':');
  String host;
  int port = this.port;
  if (i >= 0) {
    host = address.substring(0, i);
    port = Integer.parseInt(address.substring(i + 1));
  } else {
    host = address;
  }
  return new URL(protocol, username, password, host, port, path, getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

private static String[] getFilteredKeys(URL url) {
  Map<String, String> params = url.getParameters();
  if (CollectionUtils.isNotEmptyMap(params)) {
    return params.keySet().stream()
        .filter(k -> k.startsWith(HIDE_KEY_PREFIX))
        .toArray(String[]::new);
  } else {
    return new String[0];
  }
}

代码示例来源:origin: apache/incubator-dubbo

public URL setAddress(String address) {
  int i = address.lastIndexOf(':');
  String host;
  int port = this.port;
  if (i >= 0) {
    host = address.substring(0, i);
    port = Integer.parseInt(address.substring(i + 1));
  } else {
    host = address;
  }
  return new URL(protocol, username, password, host, port, path, getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public URL doConfigure(URL currentUrl, URL configUrl) {
  return currentUrl.addParametersIfAbsent(configUrl.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParameter(String key, String value) {
  if (StringUtils.isEmpty(key)
      || StringUtils.isEmpty(value)) {
    return this;
  }
  // if value doesn't change, return immediately
  if (value.equals(getParameters().get(key))) { // value != null
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(getParameters());
  map.put(key, value);
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParameter(String key, String value) {
  if (StringUtils.isEmpty(key)
      || StringUtils.isEmpty(value)) {
    return this;
  }
  // if value doesn't change, return immediately
  if (value.equals(getParameters().get(key))) { // value != null
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(getParameters());
  map.put(key, value);
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParametersIfAbsent(Map<String, String> parameters) {
  if (CollectionUtils.isEmptyMap(parameters)) {
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(parameters);
  map.putAll(getParameters());
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParametersIfAbsent(Map<String, String> parameters) {
  if (CollectionUtils.isEmptyMap(parameters)) {
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(parameters);
  map.putAll(getParameters());
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParameterIfAbsent(String key, String value) {
  if (StringUtils.isEmpty(key)
      || StringUtils.isEmpty(value)) {
    return this;
  }
  if (hasParameter(key)) {
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(getParameters());
  map.put(key, value);
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

public URL addParameterIfAbsent(String key, String value) {
  if (StringUtils.isEmpty(key)
      || StringUtils.isEmpty(value)) {
    return this;
  }
  if (hasParameter(key)) {
    return this;
  }
  Map<String, String> map = new HashMap<String, String>(getParameters());
  map.put(key, value);
  return new URL(protocol, username, password, host, port, path, map);
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public URL setProtocol(String protocol) {
  return new URL(protocol, super.getUsername(), super.getPassword(), super.getHost(), super.getPort(), super.getPath(), super.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public URL setHost(String host) {
  return new URL(super.getProtocol(), super.getUsername(), super.getPassword(), host, super.getPort(), super.getPath(), super.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public URL setProtocol(String protocol) {
  return new URL(protocol, super.getUsername(), super.getPassword(), super.getHost(), super.getPort(), super.getPath(), super.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

@Override
public URL setPassword(String password) {
  return new URL(super.getProtocol(), super.getUsername(), password, super.getHost(), super.getPort(), super.getPath(), super.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

public org.apache.dubbo.common.URL getOriginalURL() {
    return new org.apache.dubbo.common.URL(super.getProtocol(), super.getUsername(), super.getPassword(),
        super.getHost(), super.getPort(), super.getPath(), super.getParameters());
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void publishConsumer(URL consumerURL) throws RpcException {
  consumerURL = consumerURL.removeParameters(Constants.PID_KEY, Constants.TIMESTAMP_KEY, Constants.BIND_IP_KEY, Constants.BIND_PORT_KEY, Constants.TIMESTAMP_KEY);
  metadataReport.storeConsumerMetadata(new MetadataIdentifier(consumerURL.getServiceInterface(),
      consumerURL.getParameter(Constants.VERSION_KEY), consumerURL.getParameter(Constants.GROUP_KEY),Constants.CONSUMER_SIDE,
      consumerURL.getParameter(Constants.APPLICATION_KEY)), consumerURL.getParameters());
}

代码示例来源:origin: apache/incubator-dubbo

public org.apache.dubbo.common.URL getOriginalURL() {
    return new org.apache.dubbo.common.URL(super.getProtocol(), super.getUsername(), super.getPassword(),
        super.getHost(), super.getPort(), super.getPath(), super.getParameters());
  }
}

代码示例来源:origin: apache/incubator-dubbo

public void publishConsumer(URL consumerURL) throws RpcException {
  consumerURL = consumerURL.removeParameters(Constants.PID_KEY, Constants.TIMESTAMP_KEY, Constants.BIND_IP_KEY, Constants.BIND_PORT_KEY, Constants.TIMESTAMP_KEY);
  metadataReport.storeConsumerMetadata(new MetadataIdentifier(consumerURL.getServiceInterface(),
      consumerURL.getParameter(Constants.VERSION_KEY), consumerURL.getParameter(Constants.GROUP_KEY),Constants.CONSUMER_SIDE,
      consumerURL.getParameter(Constants.APPLICATION_KEY)), consumerURL.getParameters());
}

相关文章

微信公众号

最新文章

更多