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

com.evento.common.modeling.messaging.payload.Query Maven / Gradle / Ivy

The newest version!
package com.evento.common.modeling.messaging.payload;

import com.evento.common.modeling.messaging.query.QueryResponse;

import java.lang.reflect.ParameterizedType;


/**
 * The Query class is an abstract class that represents a query object. It extends the TrackablePayload class.
 * It is generic, with a type parameter T that must extend the QueryResponse class.
 *
 * @param  The type of the response object that the Query returns.
 *
 * @see TrackablePayload
 * @see QueryResponse
 */
public abstract class Query> extends TrackablePayload {

	/**
	 * Returns the response type of the Query.
	 *
	 * @return The Class object representing the response type.
	 */
	@SuppressWarnings("unchecked")
	public Class getResponseType() {
		return (Class) ((ParameterizedType) ((ParameterizedType) getClass()
				.getGenericSuperclass()).getActualTypeArguments()[0]).getRawType();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy