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

org.springframework.data.util.Sink Maven / Gradle / Ivy

The newest version!
package org.springframework.data.util;

import java.util.function.Consumer;

import org.springframework.lang.Nullable;

/**
 * A simple {@link Consumer} that captures the instance handed into it.
 *
 * @author Oliver Drotbohm
 * @since 2.4.12
 */
class Sink implements Consumer {

	private T value;

	/**
	 * Returns the value captured.
	 *
	 * @return
	 */
	public T getValue() {
		return value;
	}

	@Override
	public void accept(@Nullable T t) {
		this.value = t;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy