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

ru.progrm_jarvis.javacommons.util.BlackHole Maven / Gradle / Ivy

package ru.progrm_jarvis.javacommons.util;

import lombok.experimental.UtilityClass;

/**
 * Black hole. Helper class used to {@link #consume(Object)} values without any visible side effects.
 */
@UtilityClass
public class BlackHole {

    /**
     * Consumes the provided value without any visible side effects.
     * This may be used for scenarios when an arbitrary expression has to be treated as a statement,
     * for example{@code String.class} is an expression but not a statement
     * but {@code BlackHole.consume(String.class)} is.
     *
     * @param value consumed value
     * @param  type of consumed value
     */
    public  void consume(@SuppressWarnings("unused") final T value) {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy