ReflectiveHelper
Contains useful functions for translating class and type names to Strings and provides helper functions to access common tasks for working with reflections.
Querying methods and fields is cached.
Value members
Concrete methods
Find a method of the wrapped object by its name and argument list given.
Find a method of the wrapped object by its name and argument list given.
- Value Params
- args
the args function/method of interest
- name
the name of the function/method of interest
- on
the instance to search on
- Returns
Some(Method) if the wrapped object provides the function/method in question, None otherwise
Checks if the wrapped object provides a member (field or function/method) with the given name.
Checks if the wrapped object provides a member (field or function/method) with the given name.
- Value Params
- name
the name of the member (field or function/method) of interest
- on
the instance to search on
- Returns
true if the wrapped object provides the given member, false otherwise
Checks if the wrapped object is of type T.
Checks if the wrapped object is of type T.
- Type Params
- T
the type to check
- Value Params
- on
the instance to search on
- Returns
true if the wrapped object is of type T, false otherwise
Compares two class names.
Compares two class names.
- Value Params
- mani
the first class name derived from a class manifest (e.g., from classTag) as String
- that
the second class name already as instance of Any
- Returns
true iff both names are the same, false otherwise
Compares two class names.
Compares two class names.
- Value Params
- mani
the first class name derived from a class manifest (e.g., from classTag) as String
- that
the second class name already as String
- Returns
true iff both names are the same, false otherwise
Compares two interfaces given as Array of its Methods.
Compares two interfaces given as Array of its Methods.
- Value Params
- restrInterface
Array of Methods from the second interface
- roleInterface
Array of Methods from the first interface
- Returns
true iff all methods from the restrInterface can be found in roleInterface, false otherwise
Returns the runtime content of type T of the field with the given name of the wrapped object.
Returns the runtime content of type T of the field with the given name of the wrapped object.
- Type Params
- T
the type of the field
- Value Params
- name
the name of the field of interest
- on
the instance to search on
- Returns
the runtime content of type T of the field with the given name of the wrapped object
Returns the runtime result of type T of the given function and arguments by executing this function of the wrapped object.
Returns the runtime result of type T of the given function and arguments by executing this function of the wrapped object.
- Type Params
- T
the return type of the function
- Value Params
- args
the arguments of the function of interest
- m
the function of interest
- on
the instance to search on
- Returns
the runtime result of type T of the function with the given name by executing this function of the wrapped object
Returns the runtime result of type T of the function with the given name by executing this function of the wrapped object.
Returns the runtime result of type T of the function with the given name by executing this function of the wrapped object.
- Type Params
- T
the return type of the function
- Value Params
- name
the name of the function of interest
- on
the instance to search on
- Returns
the runtime result of type T of the function with the given name by executing this function of the wrapped object
Sets the field given as name to the provided value.
Sets the field given as name to the provided value.
- Value Params
- name
the name of the field of interest
- on
the instance to search on
- value
the value to set for this field
Translates a Class or Type name to a String, i.e. removing anything before the last occurrence
of "$
" or ".
".
Translates a Class or Type name to a String, i.e. removing anything before the last occurrence
of "$
" or ".
".
- Value Params
- t
the Class or Type name as String
- Returns
anything after the last occurrence of "
$
" or ".
"