![JAR search and dependency download from the Maven repository](/logo.png)
com.haulmont.yarg.structure.ProxyWrapper Maven / Gradle / Ivy
package com.haulmont.yarg.structure;
/**
* This interface used for proxy wrapping
*
* ex: com.haulmont.yarg.reporting.extraction.preprocessor.SqlCrosstabPreprocessor#preprocess
*/
public interface ProxyWrapper {
/**
* Internal.
* Use {@link ProxyWrapper#unwrap(java.lang.Object)} to unwrap proxied instance
*/
Object unwrap();
/**
* Method checks instance inheritance of ProxyWrapper and unwrapping their real instance
*
* @param obj - instance of any object
* @return unwrapped instance (if proxied) or same object
*/
static T unwrap(T obj) {
return obj != null && obj instanceof ProxyWrapper ? (T)((ProxyWrapper)obj).unwrap() : obj;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy