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

com.github.jhonyscamacho.domain.DomainObject Maven / Gradle / Ivy

Go to download

A set of components that help developers building their own domain object classes.

The newest version!
package com.github.jhonyscamacho.domain;

import java.io.Serializable;
import java.util.Date;

/**
 * This interface describe the methods that all domain classes, from the same
 * project, should have.
 * 
 * @author Jhonathan Camacho
 * @author Jhonys Camacho
 *
 */
public interface DomainObject extends Serializable {

	/**
	 * Returns the unique identifier of the object. Different kind of objects
	 * could have the same id.
	 * 
	 * @return the unique identifier of the object
	 */
	public long getId();

	/**
	 * Returns the version of the object. This method is also used to
	 * concurrency control.
	 * 
	 * @return the version of the object
	 */
	public int getVersion();

	/**
	 * Set the version of the object. This method is also used to concurrency
	 * control.
	 * 
	 * @param version
	 *            is the new version of the object.
	 */
	public void setVersion(final int version);

	/**
	 * Returns the creation date of the object.
	 * 
	 * @return the creation date of the object.
	 */
	public Date getCreatedAt();

	/**
	 * Sets the date on which the object was created.
	 * 
	 * @param createdAt
	 *            the date on which the object was created.
	 */
	public void setCreatedAt(Date createdAt);

	/**
	 * Returns the date on which the object was updated.
	 * 
	 * @return the date on which the object was updated.
	 */
	public Date getUpdatedAt();

	/**
	 * Returns the date on which the object was updated.
	 * 
	 * @param updatedAt
	 *            the date on which the object was updated.
	 */
	public void setUpdatedAt(Date updatedAt);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy