Add javadocs
This commit is contained in:
@@ -2,20 +2,35 @@ package com.softwaresmyth.functions;
|
|||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Utility class holding the library's methods.
|
||||||
|
*/
|
||||||
public enum OrNot
|
public enum OrNot
|
||||||
{
|
{
|
||||||
; // Enum with no variants for a utility class that is not meant to be instantiated.
|
; // Enum with no variants for a utility class that is not meant to be instantiated.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that does nothing.
|
||||||
|
* It fits any method signature that returns void.
|
||||||
|
*/
|
||||||
public static void noop(Object... ignored)
|
public static void noop(Object... ignored)
|
||||||
{
|
{
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that does nothing.
|
||||||
|
* It fits any method signature that does not return void.
|
||||||
|
*/
|
||||||
public static <T> T returnNull(Object... ignored)
|
public static <T> T returnNull(Object... ignored)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method that does nothing.
|
||||||
|
* It fits any method signature that returns {@link Optional} for any type.
|
||||||
|
*/
|
||||||
public static <T> Optional<T> returnEmpty(Object... ignored)
|
public static <T> Optional<T> returnEmpty(Object... ignored)
|
||||||
{
|
{
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
|
|||||||
Reference in New Issue
Block a user