General utility functions.
General utility functions.
(accessible-field class field-name)Returns java.lang.reflect.Field with accessibility flag set to true for
class field with given name, or nil if field not found.
Returns `java.lang.reflect.Field` with accessibility flag set to true for class field with given name, or nil if field not found.
(duration d)Coerce to a Duration instance.
Coerce to a `Duration` instance.
(qualified-name x)Given a keyword or symbol, returns the name converted to follow
OpenTelemetry conventions for attribute names; foo-bar is replaced by
foo_bar, namespace and name are separated by .. Given any
other type of argument, returns it as a snake_case string.
Given a keyword or symbol, returns the name converted to follow OpenTelemetry conventions for attribute names; foo-bar is replaced by foo_bar, namespace and name are separated by `.`. Given any other type of argument, returns it as a snake_case string.
(timestamp t)Coerce Instant to a vector [amount ^TimeUnit unit].
Coerce `Instant` to a vector `[amount ^TimeUnit unit]`.
(biconsumer f)Returns a BiConsumer implementation for function f that takes 2 args
and the result is discarded.
Returns a `BiConsumer` implementation for function `f` that takes 2 args and the result is discarded.
(bifunction f)Returns a BiFunction implementation for function f that takes 2 args.
Returns a `BiFunction` implementation for function `f` that takes 2 args.
(class-exists? class-name)Returns true if the class with the given fully qualified name is available on the current class loader.
Returns true if the class with the given fully qualified name is available on the current class loader.
(compile-if test true-expr false-expr)Evals test at macro expansion time and expands to true-expr
or false-expr based on the result.
Evals `test` at macro expansion time and expands to `true-expr` or `false-expr` based on the result.
(compile-when test true-expr)Evals test at macro expansion time and expands to true-expr
or nil based on the result.
Evals `test` at macro expansion time and expands to `true-expr` or nil based on the result.
(fn-name)Returns the name of the currently executing function, using the StackWalker
API first available in Java 9. If StackWalker is not available, returns
nil; (doto (Throwable.) .fillInStackTrace) is not used to examine the
stack, as that has poor performance with deep stacks.
Returns the name of the currently executing function, using the StackWalker API first available in Java 9. If `StackWalker` is not available, returns nil; `(doto (Throwable.) .fillInStackTrace)` is not used to examine the stack, as that has poor performance with deep stacks.
(function f)Returns a Function implementation for function f that takes one arg.
Returns a `Function` implementation for function `f` that takes one arg.
(has-method? class method-name & param-types)Returns true if the method with the given name and parameter types is available on the class.
Returns true if the method with the given name and parameter types is available on the class.
(into! to from)(into! to xf from)Same as into, but for transient to collection.
Same as `into`, but for transient `to` collection.
(predicate pred)Returns a Predicate implementation for function pred that takes 1 arg.
Returns a `Predicate` implementation for function `pred` that takes 1 arg.
(resolve-class class-name)Returns the class with the given fully qualified name, or nil if not available on the current class loader.
Returns the class with the given fully qualified name, or nil if not available on the current class loader.
(resolve-instance? class-name x)Returns true if x is an instance of class with given name. This fn is safe
to use with names of classes that may not be available on the class path.
Returns true if `x` is an instance of class with given name. This fn is safe to use with names of classes that may not be available on the class path.
(supplier f)Returns a Supplier implementation for function f that takes no args.
Returns a `Supplier` implementation for function `f` that takes no args.
(unwrap-cf-exception e)Unwraps an exception thrown from a CompletableFuture.
Unwraps an exception thrown from a `CompletableFuture`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |