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

de.malkusch.whoisServerList.api.v1.adapter.XmlCaseInsensitivePatternAdapter Maven / Gradle / Ivy

The newest version!
package de.malkusch.whoisServerList.api.v1.adapter;

import java.util.regex.Pattern;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * Case insensitive Pattern adapter.
 *
 * @author [email protected]
 * @see Donations
 */
public final class XmlCaseInsensitivePatternAdapter
        extends XmlAdapter {

    @Override
    public Pattern unmarshal(final String pattern) {
        return Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
    }

    @Override
    public String marshal(final Pattern pattern) {
        return pattern.pattern();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy