Liking cljdoc? Tell your friends :D

steffan-westcott.clj-otel.util

General utility functions.

General utility functions.
raw docstring

accessible-fieldclj

(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.
sourceraw docstring

AsDurationcljprotocol

durationclj

(duration d)

Coerce to a Duration instance.

Coerce to a `Duration` instance.
source

AsQualifiedNamecljprotocol

qualified-nameclj

(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.
source

AsTimestampcljprotocol

timestampclj

(timestamp t)

Coerce Instant to a vector [amount ^TimeUnit unit].

Coerce `Instant` to a vector `[amount ^TimeUnit unit]`.
source

biconsumerclj

(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.
sourceraw docstring

bifunctionclj

(bifunction f)

Returns a BiFunction implementation for function f that takes 2 args.

Returns a `BiFunction` implementation for function `f` that takes 2 args.
sourceraw docstring

class-exists?clj

(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.
sourceraw docstring

compile-ifcljmacro

(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.
sourceraw docstring

compile-whencljmacro

(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.
sourceraw docstring

fn-nameclj

(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.
sourceraw docstring

functionclj

(function f)

Returns a Function implementation for function f that takes one arg.

Returns a `Function` implementation for function `f` that takes one arg.
sourceraw docstring

has-method?clj

(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.
sourceraw docstring

into!clj

(into! to from)
(into! to xf from)

Same as into, but for transient to collection.

Same as `into`, but for transient `to` collection.
sourceraw docstring

predicateclj

(predicate pred)

Returns a Predicate implementation for function pred that takes 1 arg.

Returns a `Predicate` implementation for function `pred` that takes 1 arg.
sourceraw docstring

resolve-classclj

(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.
sourceraw docstring

resolve-instance?clj

(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.
sourceraw docstring

supplierclj

(supplier f)

Returns a Supplier implementation for function f that takes no args.

Returns a `Supplier` implementation for function `f` that takes no args.
sourceraw docstring

unwrap-cf-exceptionclj

(unwrap-cf-exception e)

Unwraps an exception thrown from a CompletableFuture.

Unwraps an exception thrown from a `CompletableFuture`.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close