public final class MAddonsUtils extends Object
Modifier and Type | Method and Description |
---|---|
static <A extends IAddon> |
cloneAddon(A a)
Clones an Addon, handling correctly null values.
|
static <C extends Collection<G>,G extends IAddon> |
cloneAddons(C c)
Clones a Collection of Addons, using the same Collection type as the one provided.
|
static void |
debugEntering(IExecutionContext ctxt,
IAddon addon)
Convenient method designed to be called at beginning of execution method of an addon.
|
static void |
debugExitError(IExecutionContext ctxt,
IAddon addon,
Throwable t)
Convenient method designed to be called at end of execution method of an addon.
|
static void |
debugExiting(IExecutionContext ctxt,
IAddon addon)
Convenient method designed to be called at end of execution method of an addon.
|
static void |
debugExiting(IExecutionContext ctxt,
IAddon addon,
Object result)
Convenient method designed to be called at end of execution method of an addon.
|
static void |
enterCompile(ICompilationContext ctxt,
IAddon addon,
String compileType)
Logs at compilation beginning. compileType might be provided to add information or be null to be ignored.
|
static void |
exitCompile(ICompilationContext ctxt,
IAddon addon,
String compileType)
Logs at compilation ending. compileType might be provided to add information or be null to be ignored.
|
static IEvaluationOperator |
getEvaluationOperator(String name)
Retrieves operator implementation from registered addons.
|
static ILogicalOperator |
getLogicalOperator(String name)
Retrieves operator implementation from registered addons.
|
static PersistantPropertiesTable |
getPersistantProperties(Class<?> clazz)
Returns the provided class'
PersistantProperties (name --> default value). |
static PersistantPropertiesTable |
getPersistantProperties(Object object)
Returns the provided object's class'
PersistantProperties (name --> default value). |
static Map<String,Object> |
getPersistantPropertiesValues(Object object,
boolean includeDefaults)
Returns the provided object's class'
PersistantProperties values, including or not values that are equal to defaults (name --> value). |
static boolean |
hasPersistantProperties(Class<?> clazz)
Tells if the provided class has
PersistantProperties annotation defined. |
static boolean |
hasPersistantProperties(Object object)
Tells if the provided object's class has
PersistantProperties annotation defined. |
static boolean |
isCacheUsed(Iterable<? extends IAddon> addons)
Tells if cached is used by all addons using cache in this list.
|
static IAddon |
unwrap(IAddon value)
Unwraps the provided addon if wrapped.
|
static Object |
unwrap(Object value)
Convenience method to unwrap the provided object if it's an Addon.
|
static <T extends IAddon> |
wrap(Class<T> type,
IAddon value)
Allows to automatically wrap an Addon by another, in order to directly use result.
|
public static <C extends Collection<G>,G extends IAddon> C cloneAddons(C c)
c
- Collection of addons.public static <A extends IAddon> A cloneAddon(A a)
a
- Addon.public static boolean isCacheUsed(Iterable<? extends IAddon> addons)
public static Map<String,Object> getPersistantPropertiesValues(Object object, boolean includeDefaults) throws MRuleInternalException
PersistantProperties
values, including or not values that are equal to defaults (name --> value).MRuleInternalException
public static PersistantPropertiesTable getPersistantProperties(Object object)
PersistantProperties
(name --> default value).public static PersistantPropertiesTable getPersistantProperties(Class<?> clazz)
PersistantProperties
(name --> default value). Result is never null.public static boolean hasPersistantProperties(Object object)
PersistantProperties
annotation defined.public static boolean hasPersistantProperties(Class<?> clazz)
PersistantProperties
annotation defined.public static <T extends IAddon> T wrap(Class<T> type, IAddon value)
public static Object unwrap(Object value)
public static IAddon unwrap(IAddon value)
public static ILogicalOperator getLogicalOperator(String name) throws UtilsException
name
- Unique operator name.UtilsException
public static IEvaluationOperator getEvaluationOperator(String name) throws UtilsException
name
- Unique operator name.UtilsException
public static void exitCompile(ICompilationContext ctxt, IAddon addon, String compileType)
public static void debugEntering(IExecutionContext ctxt, IAddon addon)
public static void debugExiting(IExecutionContext ctxt, IAddon addon)
public static void debugExitError(IExecutionContext ctxt, IAddon addon, Throwable t)
public static void debugExiting(IExecutionContext ctxt, IAddon addon, Object result)
public static void enterCompile(ICompilationContext ctxt, IAddon addon, String compileType)