
com.databasesandlife.util.jooq.InternetAddressLowerConverter Maven / Gradle / Ivy
package com.databasesandlife.util.jooq;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;
import org.jooq.Converter;
@SuppressWarnings("serial")
public class InternetAddressLowerConverter implements Converter {
@Override public Class fromType() { return String.class; }
@Override public Class toType() { return InternetAddress.class; }
@Override
public InternetAddress from(String x) {
try {
if (x == null) return null;
return new InternetAddress(x);
}
catch (AddressException e) { throw new RuntimeException(e); }
}
@Override
public String to(InternetAddress x) {
if (x == null) return null;
return x.getAddress().toLowerCase();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy