mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 01:12:05 +01:00
Add javadoc for UserId.parse()
This commit is contained in:
parent
675efe8a37
commit
f8f2af7d5e
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) {
|
||||
Builder builder = newBuilder();
|
||||
string = string.trim();
|
||||
|
|
Loading…
Reference in a new issue