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

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

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

Protocol.getVersion介绍

[英]Returns the version.
[中]返回版本。

代码示例

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

/**
 * Returns the name.
 * 
 * @return The name.
 */
@Override
public String toString() {
  return getName() + ((getVersion() == null) ? "" : "/" + getVersion());
}

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

/**
 * Returns the name.
 * 
 * @return The name.
 */
@Override
public String toString() {
  return getName() + ((getVersion() == null) ? "" : "/" + getVersion());
}

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

/**
 * Displays a synthesis of the request like an HTTP request line.
 * 
 * @return A synthesis of the request like an HTTP request line.
 */
public String toString() {
  return ((getMethod() == null) ? "" : getMethod().toString())
      + " "
      + ((getResourceRef() == null) ? "" : getResourceRef()
          .toString())
      + " "
      + ((getProtocol() == null) ? ""
          : (getProtocol().getName() + ((getProtocol()
              .getVersion() == null) ? "" : "/"
              + getProtocol().getVersion())));
}

代码示例来源: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;
}

代码示例来源: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: org.restlet.osgi/org.restlet

@Override
public RecipientInfoWriter append(RecipientInfo recipientInfo) {
  if (recipientInfo.getProtocol() != null) {
    appendToken(recipientInfo.getProtocol().getName());
    append('/');
    appendToken(recipientInfo.getProtocol().getVersion());
    appendSpace();
    if (recipientInfo.getName() != null) {
      append(recipientInfo.getName());
      if (recipientInfo.getComment() != null) {
        appendSpace();
        appendComment(recipientInfo.getComment());
      }
    } else {
      throw new IllegalArgumentException(
          "The name (host or pseudonym) of a recipient can't be null");
    }
  } else {
    throw new IllegalArgumentException(
        "The protocol of a recipient can't be null");
  }
  return this;
}

相关文章