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

top.cutexingluo.tools.basepackage.function.Converter Maven / Gradle / Ivy

There is a newer version: 1.1.6
Show newest version
package top.cutexingluo.tools.basepackage.function;

import org.jetbrains.annotations.Nullable;

import java.util.Objects;

/**
 * Converter interface for converting one object to another.
 * 

from org.springframework.core.convert.converter

* * @author XingTian * @version 1.0.0 * @date 2024/7/24 17:33 * @since 1.1.2 */ @FunctionalInterface public interface Converter { @Nullable T convert(S source); default Converter andThen(Converter after) { Objects.requireNonNull(after, "After Converter must not be null"); return (s) -> { T initialResult = this.convert(s); return initialResult != null ? after.convert(initialResult) : null; }; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy