Easy to adopt zero-dependency collection of helpful common interfaces, sugared with some consistent default methods.
- Interoperability. Utilizing this library increases chances of writing interoperable software.
- Sugar. This library contains some utility default method for interfaces it provides.
<dependency>
<groupId>io.github.mjcro</groupId>
<artifactId>interfaces</artifactId>
<version>1.0.3</version>
</dependency>
Name | Supports | Methods |
---|---|---|
WithActive |
boolean |
isActive , isNotActive* |
WithDeleted |
boolean |
isDeleted , isNotDeleted* |
WithEmpty |
boolean |
isEmpty , isNotEmpty* |
WithEnabled |
boolean |
isEnabled , isNotEnabled* , isDisabled* |
WithPublich |
boolean |
isPublic , isNotPublic* |
WithVisible |
boolean |
isVisible , isNotVisible* , isHidden* |
WithState |
enum |
getState , hasState* , notHasState* ,hasStateOneOf* , notHasStateOneOf* |
WithStatus |
enum |
getStatus , hasStatus* , notHasStatus* ,hasStatusOneOf* , notHasStatusOneOf* |
WithType |
enum |
getType , hasType* , notHasType* ,hasTypeOneOf* , notHasTypeOneOf* |
WithId |
int ,long ,short ,string ,byte[] |
getId , hasId* , getIdBase64* |
WithParentId |
int ,long ,short |
getParentId , hasParentId* |
WithGateId |
int ,long ,short |
getGateId , hasGateId* |
WithScopeId |
int ,long ,short |
getScopeId , hasScopeId* |
WithOptionalId |
int ,long ,short ,string |
getId , hasId* , mustGetId* |
WithOptionalParentId |
int ,long ,short |
getParentId , hasParentId* ,mustGetParentId |
WithSize |
int |
size , isEmpty* , isNotEmpty* |
WithTypeId |
int |
getTypeId , hasTypeId* |
WithName |
string |
getName , hasName* |
WithUri |
string |
getURI , hasURI* |
WithOptionalName |
string |
getName , hasName* , mustGetName* |
WithElapsed |
duration |
getElapsed , getElapsedSeconds* ,getElapsedMillis* , getElapsedNanos* |
WithTime |
instant |
getTime , getTimeEpochSeconds* ,getTimeEpochMilli* , formatTimeISOInstant* |
WithCreatedAt |
instant |
getCreatedAt , getCreatedAtEpochSeconds* ,getCreatedAtEpochMilli* ,formatCreatedAtISOInstant* |
WithExpiryAt |
instant |
getExpiryAt , getExpiryAtEpochSeconds* ,getExpiryAtEpochMilli* ,formatExpiryAtISOInstant* |
WithModifiedAt |
instant |
getModifiedAt , getModifiedAtEpochSeconds* ,getModifiedAtEpochMilli* ,formatModifiedAtISOInstant* |
WithScheduledAt |
instant |
getScheduledAt , getScheduledAtEpochSeconds* ,getScheduledAtEpochMilli* ,formatScheduledAtISOInstant* |
WithUpdatedAt |
instant |
getUpdatedAt , getUpdatedAtEpochSeconds* ,getUpdatedAtEpochMilli* ,formatUpdatedAtISOInstant* |
WithOptionalExpiryAt |
instant |
getUpdatedAt , hasExpiryAt* ,mustGetExpiryAt , getUpdatedAtEpochSeconds* ,getUpdatedAtEpochMilli* ,formatUpdatedAtISOInstant* |
WithOptionalModifiedAt |
instant |
getUpdatedAt , hasModifiedAt* ,mustGetModifiedAt , getUpdatedAtEpochSeconds* ,getUpdatedAtEpochMilli* ,formatUpdatedAtISOInstant* |
WithOptionalScheduledAt |
instant |
getUpdatedAt , hasScheduledAt* ,mustGetScheduledAt , getUpdatedAtEpochSeconds* ,getUpdatedAtEpochMilli* ,formatUpdatedAtISOInstant* |
WithOptionalUpdatedAt |
instant |
getUpdatedAt , hasUpdatedAt* ,mustGetUpdatedAt , getUpdatedAtEpochSeconds* ,getUpdatedAtEpochMilli* ,formatUpdatedAtISOInstant* |
WithByteBody |
byte[] |
getBody , isBodyEmpty* ,isBodyPresent* , getBodyString* ,getBodyBase64* , getBodyInputStream* |
WithDataClass |
class |
getDataClass |
WithException |
exception |
getException |
WithOptionalException |
exception |
getException , hasException* , hasNoException* |
- Marked with
*
are default implementations.
- Any interface with
get*
has correspondinghas*
returningboolean
- Any interface with
get*
returningOptional<?>
:- Has corresponding
mustGet*
getter - Has corresponding
has*
method with no arguments
- Has corresponding
TriConsumer<A, B, C>
- likeBiConsumer
but with three argumentsTriFunction<A, B, C, R>
- likeBiFunction
but with three argumentsTriPredicate<A, B, C>
- likeBiPredicate
but with three arguments
Set of interfaces mirroring java.util.function.*
but able to throw checked exceptions.
All of them are @FunctionalInterface
, all have from*
static methods to convert plain Java functions into
exceptionals.
ExceptionalBiConsumer<T, U>
ExceptionalBiFunction<T, U, R>
ExceptionalBiPredicate<T, U>
ExceptionalConsumer<T>
ExceptionalFunction<T, R>
ExceptionalPredicate<T>
ExceptionalSupplier<T>
ExceptionalTriConsumer<A, B, C>
ExceptionalTriFunction<A, B, C, R>
ExceptionalTriPredicate<A, B, C>
ExceptionalUnaryOperator<T>