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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 697e8ecbb9f773c88fa45b6902cbadedf78baf30b7dd35bab0271562819f7437 |
|
MD5 | 4e7b51206093ec4b63721d256401a7d5 |
|
BLAKE2b-256 | 20279db52ee9421e7c6152663613f77f4582b4587c2e7f4e5aaee87217bc737e |
Hashes for guava_preconditions-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f3b298b4060dd2953b2555b4f38641def470f75a704453ef4cdc645ee1aaab |
|
MD5 | 8740ed16878afc83da00abf59cf0542f |
|
BLAKE2b-256 | 8be1b1a4dfd7629ffeb69b1d7c0033bcb64e519c0c0671360ec9d51fc7e52983 |