org.restlet.data.Protocol.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(152)

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

Protocol.<init>介绍

[英]Constructor.
[中]建造师。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Returns a protocol by its scheme. If the latter is unknown, instantiate a
 * new protocol object.
 * 
 * @param scheme
 *            the scheme of the desired protocol.
 * @return a known protocol or a new instance.
 */
private Protocol getProtocol(String scheme) {
  Protocol protocol = Protocol.valueOf(scheme);
  if (protocol == null) {
    protocol = new Protocol(scheme);
  }
  return protocol;
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Returns a protocol by its scheme. If the latter is unknown, instantiate a
 * new protocol object.
 * 
 * @param scheme
 *            the scheme of the desired protocol.
 * @return a known protocol or a new instance.
 */
private Protocol getProtocol(String scheme) {
  Protocol protocol = Protocol.valueOf(scheme);
  if (protocol == null) {
    protocol = new Protocol(scheme);
  }
  return protocol;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

result = ZIP;
} else {
  result = new Protocol(name);

代码示例来源:origin: org.restlet/org.restlet

result = WAR;
} else {
  result = new Protocol(name);

代码示例来源:origin: org.restlet.osgi/org.restlet

result = ZIP;
} else {
  result = new Protocol(name);

代码示例来源:origin: org.restlet.osgi/org.restlet

result.setProtocol(new Protocol(protocolToken, protocolToken, null,
      -1, readToken()));
} else {
  result.setProtocol(new Protocol("HTTP", "HTTP", null, -1,
      protocolToken));

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Creates the protocol associated to a URI scheme name. If an existing
 * constant exists then it is returned, otherwise a new instance is created.
 * 
 * @param name
 *            The scheme name.
 * @param version
 *            The version number.
 * @return The associated protocol.
 */
public static Protocol valueOf(String name, String version) {
  Protocol result = valueOf(name);
  if (!version.equals(result.getVersion())) {
    result = new Protocol(result.getSchemeName(), result.getName(),
        result.getTechnicalName(), result.getDescription(),
        result.getDefaultPort(), result.isConfidential(), version);
  }
  return result;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Creates the protocol associated to a URI scheme name. If an existing
 * constant exists then it is returned, otherwise a new instance is created.
 * 
 * @param name
 *            The scheme name.
 * @param version
 *            The version number.
 * @return The associated protocol.
 */
public static Protocol valueOf(String name, String version) {
  Protocol result = valueOf(name);
  if (!version.equals(result.getVersion())) {
    result = new Protocol(result.getSchemeName(), result.getName(),
        result.getTechnicalName(), result.getDescription(),
        result.getDefaultPort(), result.isConfidential(), version);
  }
  return result;
}

相关文章