mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 04:42:06 +01:00
Add javadoc for UserId.parse()
This commit is contained in:
parent
59217d2501
commit
94851ccb8f
1 changed files with 18 additions and 0 deletions
|
@ -69,6 +69,24 @@ public final class UserId implements CharSequence {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a {@link UserId} from free-form text, <pre>name-addr</pre> or <pre>mailbox</pre> string and split it
|
||||||
|
* up into its components.
|
||||||
|
* Example inputs for this method:
|
||||||
|
* <ul>
|
||||||
|
* <li><pre>john@pgpainless.org</pre></li>
|
||||||
|
* <li><pre><john@pgpainless.org></pre></li>
|
||||||
|
* <li><pre>John Doe</pre></li>
|
||||||
|
* <li><pre>John Doe <john@pgpainless.org></pre></li>
|
||||||
|
* <li><pre>John Doe (work email) <john@pgpainless.org></pre></li>
|
||||||
|
* </ul>
|
||||||
|
* In these cases, {@link #parse(String)} will detect email addresses, names and comments and expose those
|
||||||
|
* via the respective getters.
|
||||||
|
*
|
||||||
|
* @see <a href="https://www.rfc-editor.org/rfc/rfc5322#page-16">RFC5322 §3.4. Address Specification</a>
|
||||||
|
* @param string user-id
|
||||||
|
* @return parsed {@link UserId} object
|
||||||
|
*/
|
||||||
public static UserId parse(@Nonnull String string) {
|
public static UserId parse(@Nonnull String string) {
|
||||||
Builder builder = newBuilder();
|
Builder builder = newBuilder();
|
||||||
string = string.trim();
|
string = string.trim();
|
||||||
|
|
Loading…
Reference in a new issue