All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jaxx.runtime.Decorator Maven / Gradle / Ivy

The newest version!
package jaxx.runtime;

/**
 * A simple contract to define a String decorator on any java objet.
 *
 * @param  the type of decorated object
 * @author chemit
 */
public abstract class Decorator implements java.io.Serializable {

    protected final Class internalClass;
    private static final long serialVersionUID = -1L;

    /**
     * @param internalClass the class of objects to be decorated.
     * @throws NullPointerException if internalClass parameter is null
     */
    public Decorator(Class internalClass) throws NullPointerException {
        if (internalClass == null) {
            throw new NullPointerException("internalClass can not be null.");
        }
        this.internalClass = internalClass;
    }

    /**
     * @param bean the bean to decorate
     * @return the string value of the given bean
     */
    public abstract String toString(Object bean);


    public final Class getInternalClass() {
        return internalClass;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy