All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.mailer.runtime.TrimmedPatternConverter Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.mailer.runtime;

import java.util.regex.Pattern;

import org.eclipse.microprofile.config.spi.Converter;

public class TrimmedPatternConverter implements Converter {

    public TrimmedPatternConverter() {
    }

    @Override
    public Pattern convert(String s) {
        if (s == null) {
            return null;
        }

        String trimmedString = s.trim().toLowerCase();

        if (trimmedString.isEmpty()) {
            return null;
        }

        return Pattern.compile(trimmedString, Pattern.CASE_INSENSITIVE);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy