core library
Basic utilities to manipulate common data-types, skeleton types to simplify equality and comparison operations, and monads.
Classes
- Debounce
- Represents a capped exponential back-off in milliseconds with jittering.
- PlatformDependent
- Denotes that an annotated type is platform dependent
-
Result<
T, E> - A monad that represents the result of an operation which may contain a value if successful, or an error otherwise.
-
Subset<
T> - Denotes that an annotated function returns a union type. A union type represents a subset of possible values.
- Throws
- Denotes that an annotated method throws the given exceptions.
- Types
- Provides utilities for comparing and manipulating types.
-
Union<
L, R> - A monad that represents a union type.
Mixins
- Disposable
- Signifies that the implementing type holds resource (i.e. sockets, streams) that need to be manually disposed.
- Equality
- A skeleton to simplify implementation of symmetrical equality.
-
Relatable<
T extends Relatable< T> > - A skeleton that implements comparison operators using compareTo.
Extensions
- Calls on Call
- Contains functions for composing Calls and other operations.
-
Consumers
on Consumer<
T> -
Contains functions for composing
Consumer
s. - HashExtensions on String
- An extension that provides additional hashing methods.
- Integers on int
- Utilities for handling overflows.
-
Mappers
on Mapper<
T, R> - Contains functions for composing Mappers and other operations.
- PaddedNumber on T
- Utilities for formatting numbers.
-
Predicates
on Predicate<
T> - Contains functions for composing Predicates and other operations.
- RoundableNumber on T
- Utilities for rounding a number.
- Strings on String
- Utilities for manipulating Strings.
-
Suppliers
on Supplier<
T> - Contains functions for composing Suppliers and other operations.
Constants
- annotation → const String
- Denotes that the annotated type is an annotation.
- throws → const String
- Denotes that the annotated method throws an exception.
- untestable → const String
- Denotes that the annotated type/method is untestable.
Functions
-
ceil<
T extends num> (T value, num nearest) → T -
Ceils
value
to the nearestnearest
. -
floor<
T extends num> (T value, num nearest) → T -
Floors
value
to the nearestnearest
. -
max<
T extends Comparable< (T> >T a, T b) → T - Returns the larger of two Comparables.
-
min<
T extends Comparable< (T> >T a, T b) → T - Returns the smaller of two Comparables.
-
nonce(
[int length = 32]) → String - Generates a random nonce.
-
round<
T extends num> (T value, num nearest) → T -
Rounds
value
to the nearestnearest
.
Typedefs
- Call = void Function()
- Represents an operation with no arguments.
-
Consumer<
T> = void Function(T) - Represents an operation that accepts a single argument.
-
Mapper<
T, R> = R Function(T) -
Maps a value of type
T
toR
. -
Predicate<
T> = bool Function(T) - Represents a predicate (boolean-valued function) of one argument.
-
Supplier<
T> = T Function() - Represents a supplier of results.
Exceptions / Errors
- ResultError
- Signals that an error has occurred while manipulating a Result.