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

com.databasesandlife.util.wicket.CleartextPasswordConverter Maven / Gradle / Ivy

There is a newer version: 21.0.1
Show newest version
package com.databasesandlife.util.wicket;

import com.databasesandlife.util.gwtsafe.CleartextPassword;
import org.apache.wicket.util.convert.ConversionException;
import org.apache.wicket.util.convert.IConverter;

import java.util.Locale;

/**
 * Wicket Converter for {@link CleartextPassword}.
 *
 * @author This source is copyright Adrian Smith and licensed under the LGPL 3.
 * @see Project on GitHub
 */
public class CleartextPasswordConverter implements IConverter {

    @Override public CleartextPassword convertToObject(String value, Locale locale)
    throws ConversionException {
        if (value == null) return null;
        return new CleartextPassword(value);
    }

    @Override public String convertToString(CleartextPassword value, Locale locale) {
        if (value == null) return null;
        return value.getCleartext();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy