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.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ReflectiveHelper.type
Members list
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 parameters
- args
-
the args function/method of interest
- name
-
the name of the function/method of interest
- on
-
the instance to search on
Attributes
- 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 parameters
- name
-
the name of the member (field or function/method) of interest
- on
-
the instance to search on
Attributes
- 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 parameters
- T
-
the type to check
Value parameters
- on
-
the instance to search on
Attributes
- Returns
-
true if the wrapped object is of type T, false otherwise
Compares two class names.
Compares two class names.
Value parameters
- 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
Attributes
- Returns
-
true iff both names are the same, false otherwise
Compares two class names.
Compares two class names.
Value parameters
- mani
-
the first class name derived from a class manifest (e.g., from classTag) as String
- that
-
the second class name already as String
Attributes
- 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 parameters
- restrInterface
-
Array of Methods from the second interface
- roleInterface
-
Array of Methods from the first interface
Attributes
- 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 parameters
- T
-
the type of the field
Value parameters
- name
-
the name of the field of interest
- on
-
the instance to search on
Attributes
- 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 parameters
- T
-
the return type of the function
Value parameters
- args
-
the arguments of the function of interest
- m
-
the function of interest
- on
-
the instance to search on
Attributes
- 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 parameters
- T
-
the return type of the function
Value parameters
- name
-
the name of the function of interest
- on
-
the instance to search on
Attributes
- 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 parameters
- name
-
the name of the field of interest
- on
-
the instance to search on
- value
-
the value to set for this field
Attributes
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 parameters
- t
-
the Class or Type name as String
Attributes
- Returns
-
anything after the last occurrence of "
$
" or ".
"