std.object.element.util
box-arg
added in 3.0
(box-arg param-type arg)Converts primitives to their correct data types (box-arg Float/TYPE 2) => 2.0
(box-arg Integer/TYPE 2.001) => 2
(type (box-arg Short/TYPE 1.0)) => java.lang.Short
box-args
added in 3.0
(box-args ele args)makes the parameters of the arguments conform to the function signature
(-> (query/query-class String “charAt” :#) (box-args “0123” 1)) => “0123” 1
element-params-method
added in 3.0
(element-params-method ele)arglist parameters for an element
(-> (query/query-class String “charAt” :#) (element-params-method)) => ’java.lang.String int
format-element-method
added in 3.0
(format-element-method ele)readable string representation of an element
(-> (query/query-class String “charAt” :#) (format-element-method)) => “charAt :: (java.lang.String, int) -> char”
is-congruent
added in 3.0
(is-congruent params args)makes sure the argument types match with the param types
(is-congruent Integer/TYPE String Long String) => true
param-arg-match
added in 3.0
(param-arg-match param-type arg-type)Checks if the second argument can be used as the first argument (param-arg-match Double/TYPE Float/TYPE) => true
(param-arg-match Float/TYPE Double/TYPE) => true
(param-arg-match Integer/TYPE Float/TYPE) => false
(param-arg-match Byte/TYPE Long/TYPE) => false
(param-arg-match Long/TYPE Byte/TYPE) => true
(param-arg-match Long/TYPE Long) => true
(param-arg-match Long Byte) => false
(param-arg-match clojure.lang.PersistentHashMap java.util.Map) => false
(param-arg-match java.util.Map clojure.lang.PersistentHashMap) => true
param-float-match
added in 3.0
(param-float-match param-type arg-type)matches floats to integer inputs
(param-float-match Float/TYPE Long/TYPE) => true
(param-float-match Float/TYPE Long) => true
(param-float-match Float Integer) => true
(param-float-match Float Integer/TYPE) => true
set-field
added in 3.0
(set-field field obj val)base function to set the field value of a particular object
throw-arg-exception
macro
added in 3.0
(throw-arg-exception ele args & [header])helper macro for box-args to throw readable messages