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

com.buschmais.xo.api.CompositeObject Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package com.buschmais.xo.api;

/**
 * Defines an interface which is transparently implemented by all composite
 * instances created by the {@link XOManager}.
 */
public interface CompositeObject {

    /**
     * Return the id of the object.
     *
     * @param 
     *            The id type.
     * @return The id of the object.
     */
     I getId();

    /**
     * Cast the instance to a specific type.
     *
     * @param type
     *            The type.
     * @param 
     *            The type.
     * @return The instance.
     */
     T as(Class type);

    /**
     * Return the underlying datastore delegate.
     *
     * @param 
     *            The expected type.
     * @return The datastore delegate.
     */
     D getDelegate();

}