/** * Returns the name. * * @return The name. */ @Override public String toString() { return getName() + ((getVersion() == null) ? "" : "/" + getVersion()); }
/** * Returns the name. * * @return The name. */ @Override public String toString() { return getName() + ((getVersion() == null) ? "" : "/" + getVersion()); }
/** * 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()))); }
/** * 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; }
/** * 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; }
@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; }