Package-level declarations
Types
Shorter name for InstantTimeProvider.
Implementation of TimeProvider providing access to Instant.now method.
Implementation of TimeProvider providing access to LocalDateTime.now method.
This name makes a bit more sense as we're constraining to temporal.
Interface providing access to current time via now method.
Functions
Calls the specified function block with this
value as its receiver if and only if the shouldApply parameter is true. Returns this
value.
Calls the specified function block with this
value as its receiver if and only if the shouldApplyBlock lambda returns true. Returns this
value.
Returns a Map containing key-value pairs provided by elements of the given collection.
Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.
Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.
Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself.
Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and value is provided by the valueTransform function applied to elements of the given collection.
Populates and returns the destination mutable map with key-value pairs provided by elements of the given collection.
Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given collection.
Populates and returns the destination mutable map with key-value pairs for each element of the given collection, where key is the element itself and value is provided by the valueSelector function applied to that key.
Builds a new Array by populating a MutableList using the given builderAction and returning an Array with the same elements.
List cartesian production.
Computes MD5 from given byte array, returns base64 encoded data.
Serializes given object to string.
Serializes given object to byte array.
Serializes given object to string.
Computes duration in milliseconds between two Instant instances.
Computes duration in milliseconds between two Instant instances.
Compares two strings ignoring case.
Returns an array containing all elements that are instances of specified type parameter R.
Randomly sorts the items with respect to the current weight distribution. normalizer is used to normalize the random value obtained from rand to control how important the original weights are. With higher normalizer the importance of the random factor decreases.
Returns week of year for this.
Creates SHA256 hash of the given file.
Creates SHA256 hash of the given byte array.
Creates SHA256 hash of the given text.
Returns true when there is at least one element x for which x in this and x in other returns true.
Formats a collection of TItems to a readable string like "3 colors: red, yellow, green".
Standard ObjectMapper configured in a way the platform operates.
ObjectMapper with registered Kotlin plugin and given settings.
Returns the largest value of the given function or null
if there are no elements.
Returns the smallest value of the given function or null
if there are no elements.
Tries to create instance of T from provided json, null is returned when it is not possible to parse it. If logParserException set to true and exception is raised during JSON parsing, it is logged.
Pretty print a json.
Prints @param promptText, reads input from console and applies @param transform to it. If @param transform throws an exception on user input, @param exceptionHandler will be invoked, and prompt will be repeated.
Loads properties file from the resources. Returns null if the properties were not loaded.
Returns this LocalDate with week of the year set to week and day of the week set to DayOfWeek.MONDAY. I.e. when this date is 23-08-2019 and week is 2, the returned date is 07-01-2019.
Returns single element, or null
if the collection is empty. Throws IllegalArgumentException when multiple elements are matching predicate.
Returns the single element matching the given predicate, or null
if element was not found.
Converts stacktrace to the string. Uses Throwable.printStackTrace and returns it as string.
Returns true if the string starts with a latin letter a-z or A-Z.
Sums all Lists of integers into single one by indexes (i.e. all the numbers with the same index are always summed together). If the lists have different lengths, the final list has length corresponding to the shortest list in this iterable.
Swaps dimensions in two-dimensional map. The returned map has keys from the second dimension as primary keys and primary keys are used in the second dimension.
Swaps dimensions in two-dimensional map. The returned map has keys from the second dimension as primary keys and primary keys are stored in the second dimension. topDestination specifies which map should be used to store the new primary keys and bottomDestination is used to store the new secondary keys.
Works similarly as swapKeys but the final map has three levels. transform specifies how the keys should be swapped (or modified) in the newly created map. topDestination specifies which map should be used to store the new primary keys, middleDestination is used to store the new secondary keys and bottomDestination is used to store the new tertiary keys.
Returns a NavigableSet of all elements.
Extracts the essential information from an object (most usually a string), whose toString() call result has a similar format as the output of function toLongString . If the format is not similar, it simply returns this.toString() .
Works similarly as toTwoLevelMap but the final map has three levels.
Works similarly as toTwoLevelMap but the final map has three levels. topDestination specifies which map should be used to store the new primary keys, middleDestination is used to store the new secondary keys and bottomDestination is used to store the new tertiary keys.
Transforms list of pairs, where the first element consists of pairs into two-dimensional map where the first elements from the inner pair are used as primary keys and second elements as secondary keys.
Transforms map of pairs as a keys into two-dimensional map where the first elements in the pair are used as primary keys and second elements as secondary keys.
Transforms list of pairs, where the first element consists of pairs into two-dimensional map where the first elements from the inner pair are used as primary keys and second elements as secondary keys. topDestination specifies which map should be used to store the new primary keys and bottomDestination is used to store the new secondary keys.
Transforms map of pairs as a keys into two-dimensional map where the first elements in the pair are used as primary keys and second elements as secondary keys. topDestination specifies which map should be used to store the new primary keys and bottomDestination is used to store the new secondary keys.
Read ByteArray as two longs and combine the to UUID.
If isValid is true, executes invalidBlock. Used mainly for validating entities -> do something when validation failed.
If isValidSelector returns true, executes invalidBlock. Used mainly for validating entities -> do something when validation failed.
Properties
Shortcut for System.lineSeparator.