phone-number.util

added in 8.12.4-0

Singleton wrappers and helpers for phone-number.

available-locales

added in 8.12.4-1

deprecated in 8.12.4-3

DEPRECATED: Please use phone-number.locale/by-val-vec.

available-locales-vec

added in 8.12.4-1

deprecated in 8.12.4-3

DEPRECATED: Please use phone-number.locale/by-val-vec.

carrier-mapper

added in 8.12.4-0

(carrier-mapper)

char-ranges->set

added in 8.12.4-1

(char-ranges->set & ranges)

Returns a set of characters defined as a collection of collections with start and stop character, e.g.: \A \Z

count-digits

added in 8.12.4-1

(count-digits n)

fmap-k

added in 8.12.4-0

(fmap-k f m)(fmap-k f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with values updated by the results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

fmap-v

added in 8.12.16-1

(fmap-v f m)(fmap-v f m dst)

For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with values updated by the results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

gen-digits

added in 8.12.4-0

(gen-digits num)(gen-digits num rng)

Generates the given number of random digits and converts all into a single string. When the second argument is present it should be an instance of random number generator used to get the digits.

gen-is

macro

added in 8.12.4-0

(gen-is k f)

For the given keyword k and function name f uses gen-is-sexp to generate predicate function definitions.

gen-ises

macro

added in 8.12.4-0

(gen-ises coll f)

Takes a collection of keywords (evaluated) and a function expressed as a symbol (not evaluated) and generates bunch of function definitions using gen-is-sexp.

geo-coder

added in 8.12.4-0

(geo-coder)

get-rand-int

added in 8.12.4-0

(get-rand-int n)(get-rand-int n rng)

Like rand-int but optionally uses random number generator.

get-rand-nth

added in 8.12.4-0

(get-rand-nth v)(get-rand-nth v rng)

Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.

inferred-contains?

added in 8.12.4-0

(inferred-contains? coll k)

Just like the contains? but if the keyword is namespace-qualified it also checks if the collection contains the same keyword as its key but without a namespace.

inferred-get

added in 8.12.4-0

(inferred-get coll k)(inferred-get coll k default)

Just like the get function but if the keyword is namespace-qualified it first attempts to look for the value associated with it. If that fails it uses the variant of the keyword without any namespace.

instance

added in 8.12.4-0

(instance)

lazy-iterator-seq

added in 8.12.4-0

(lazy-iterator-seq coll)(lazy-iterator-seq coll iter)

Returns a lazy sequence as an interface to the given iterable Java object.

map-of-sets-invert

added in 8.12.16-1

(map-of-sets-invert m)

Like clojure.set/map-invert but for map of sets (as values) to preserve all possible values (as keys of newly created map).

ns-infer

added in 8.12.4-0

(ns-infer ns-name k)(ns-infer ns-name k use-infer)

Takes a string of namespace name and a keyword. If the given keyword is not namespace-qualified it returns a new keyword with the given namespace added. If the given keyword is already equipped with a namespace it returns it.

random-digits-len

added in 8.12.4-0

(random-digits-len x iteration shrink-now)(random-digits-len x iteration shrink-now rng)

For 0 or 1 it returns its argument. For other positive numbers it returns a random natural number from 1 to this number (inclusive) in 50% cases. In other 50% cases it returns its argument.

remove-empty-vals

added in 8.12.4-0

(remove-empty-vals m)

Removes empty values from a map.

short

added in 8.12.4-0

(short)

time-zones-mapper

added in 8.12.4-0

(time-zones-mapper)

try-null

macro

added in 8.12.4-0

(try-null & body)

Evaluates body and if NullPointerException exception is caught it returns nil. Otherwise it returns the value of last expression in the body.

try-parse

macro

added in 8.12.4-0

(try-parse & body)

Evaluates body and if NumberParseException or NumberFormatException exception is caught it returns nil.

try-parse-or-false

macro

added in 8.12.4-0

(try-parse-or-false & body)

Evaluates body and if NumberParseException or NumberFormatException exception is caught it returns false.

valid-locale?

added in 8.12.4-1

deprecated in 8.12.4-3

(valid-locale? locale-specification)

DEPRECATED: Please use phone-number.locale/valid?.

when-not-empty

macro

added in 8.12.16-1

(when-not-empty val & body)

Evaluates body when the given value is a non-empty collection.

with-not-empty

added in 8.12.16-1

(with-not-empty obj)

Returns the collection if it’s not empty. Otherwise returns nil.