Package io.cui.tools.net
Class IDNInternetAddress
- java.lang.Object
-
- io.cui.tools.net.IDNInternetAddress
-
public final class IDNInternetAddress extends Object
Utility class to handle IDN email addresses.
See- Author:
- Matthias Walliczek
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdecode(@NonNull String completeAddress)Decode the domain part of an email addressstatic Stringdecode(@NonNull String completeAddress, UnaryOperator<String> sanitizer)Decodes the given address and sanitizes the elements with the provided sanitizer.static Stringencode(@NonNull String completeAddress)Encode the domain part of an email addressstatic Stringencode(@NonNull String completeAddress, UnaryOperator<String> sanitizer)Encodes the given address and sanitizes the elements with the provided sanitizer.
-
-
-
Method Detail
-
encode
public static String encode(@NonNull @NonNull String completeAddress)
Encode the domain part of an email address- Parameters:
completeAddress- the address to encode in RFC822 format- Returns:
- the encoded address in RFC822 format
-
encode
public static String encode(@NonNull @NonNull String completeAddress, UnaryOperator<String> sanitizer)
Encodes the given address and sanitizes the elements with the provided sanitizer. It takes care on the special elements like<>by not trying to sanitize them.- Parameters:
completeAddress-sanitizer- to be passed as UnaryOperator- Returns:
- the sanitized and encoded address.
-
decode
public static String decode(@NonNull @NonNull String completeAddress)
Decode the domain part of an email address- Parameters:
completeAddress- the address to decode in RFC822 format- Returns:
- the decoded address in RFC822 format
-
decode
public static String decode(@NonNull @NonNull String completeAddress, UnaryOperator<String> sanitizer)
Decodes the given address and sanitizes the elements with the provided sanitizer. It takes care on the special elements like <> by not trying to sanitize them.- Parameters:
completeAddress-sanitizer- to be passed as UnaryOperator- Returns:
- the sanitized and decoded address.
-
-