Newer
Older
sanitizer / src / main / java / io / ljunggren / sanitizer / cleanser / Cleanser.java
package io.ljunggren.sanitizer.cleanser;

/**
 * Strategy interface for cleansing a value of type {@code T}.
 *
 * @param <T> the type of value the cleanser operates on
 */
public interface Cleanser<T> {

    /**
     * Apply the cleansing rule to the given value.
     *
     * @param value input value (implementations should accept {@code null})
     * @return the cleansed value
     */
    String cleanse(T value);

    /**
     * @return human-readable description of what this cleanser does
     */
    String description();

}