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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e58b7136237040eb61a06ef5bcf68845936eae9004a1a413e05d8e3614877011 |
|
MD5 | 12b89f5f7202f472bd01291c24d10bfd |
|
BLAKE2b-256 | c941f6a822e520950a11f3fbe10727b80b4cd208443c32c8ff09549896a0cb2c |
Hashes for guava_preconditions-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8051e91c5413dd0ba9a0af0ce478852880617838ea4916f0b058cce7d50aa3e8 |
|
MD5 | 114607a49db8ef803d838aa72382b310 |
|
BLAKE2b-256 | 12392a0d330602d466af44fbbcc3d0874ae04556023bc4e85304d0f701cc0540 |