Package net.neoforged.neoforge.transfer
Class TransferPreconditions
java.lang.Object
net.neoforged.neoforge.transfer.TransferPreconditions
Precondition checks useful for implementing
ResourceHandler.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckNonEmpty(Resource resource) Ensures the resource is non-empty, throws otherwise.static voidcheckNonEmptyNonNegative(Resource resource, int value) Ensures the resource is non-empty and the value is non-negative, throws otherwise.static voidcheckNonNegative(int value) Ensures the value is non-negative, throws otherwise.
-
Constructor Details
-
TransferPreconditions
private TransferPreconditions()
-
-
Method Details
-
checkNonEmpty
Ensures the resource is non-empty, throws otherwise.- Throws:
IllegalArgumentException- when resource is empty.
-
checkNonNegative
public static void checkNonNegative(int value) Ensures the value is non-negative, throws otherwise.- Throws:
IllegalArgumentException- when value is negative.
-
checkNonEmptyNonNegative
Ensures the resource is non-empty and the value is non-negative, throws otherwise.- Throws:
IllegalArgumentException- when resource is empty or value is negative.
-