A python version of guava's preconditions
Project description
guava_preconditions
This library provides some simple functions from guava
Module guava_preconditions
Functions
checkArgument(expression: bool, errorMessageTemplate: Optional[str] = None, *errorMessageArgs: Any) ‑> None
: Ensures the truth of an expression involving one or more parameters to the calling method.
checkElementIndex(index: int, size: int, desc: str = None) ‑> int
: Ensures that index specifies a valid element in an array, list or string of size size.
checkNotNull(reference: Optional[~T], errorMessageTemplate: str, *errorMessageArgs: Any) ‑> ~T
: Ensures that an object reference passed as a parameter to the calling method is not null.
checkPositionIndex(index: int, size: int, desc: str = None) ‑> int
: Ensures that index specifies a valid position in an array, list or string of size size.
checkPositionIndexes(start: int, end: int, size: int) ‑> None
: Ensures that start and end specify a valid positions in an array, list or string of size size, and are in order.
checkState(expression: bool, errorMessageTemplate: str = None, *errorMessageArgs: Any) ‑> None
: Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
Classes
IllegalArgumentException(*args, **kwargs)
: Common base class for all non-exit exceptions.
### Ancestors (in MRO)
* builtins.Exception
* builtins.BaseException
IllegalStateException(*args, **kwargs)
: Common base class for all non-exit exceptions.
### Ancestors (in MRO)
* builtins.Exception
* builtins.BaseException
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for guava_preconditions-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99088bc06a69e67d0d76e0221fc8850dfd258e083b0fc4a26ebce92eed21130d |
|
MD5 | 130f61824978acd9233246fa76c33d9c |
|
BLAKE2b-256 | 53bce84ad7db3fe6215d33abcf6008897db2ffad8566b5ed99276a481bc015f4 |
Hashes for guava_preconditions-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e4705319ae46e4e694f87b481c745e2cb95c747f596754d830837a50ed81be |
|
MD5 | 67fbcf42e3d4aab91e4b3cf5fb94422e |
|
BLAKE2b-256 | 320227fdaa2865b4520030fb13773cf9dd5b67f3d3c43b277f131f789534f675 |