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

com.foreach.across.modules.entity.business.EntityWrapper Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package com.foreach.across.modules.entity.business;

import com.foreach.across.modules.entity.registry.EntityConfiguration;

import java.io.Serializable;

/**
 * Wraps around an entity instance providing access to the generated properties.
 */
@Deprecated
public class EntityWrapper
{
	private final EntityConfiguration entityConfiguration;

	private Object entity;

	public EntityWrapper( EntityConfiguration entityConfiguration, Object entity ) {
		this.entityConfiguration = entityConfiguration;
		this.entity = entity;
	}

	@SuppressWarnings("unchecked")
	public Serializable getId() {
		return entityConfiguration.getEntityModel().getId( entity );
	}

	public String getEntityLabel() {
		return entity != null ? entity.toString() : "unknown";
	}

	/**
	 * @return The entity instance that is being wrapped.
	 */
	public Object getEntity() {
		return entity;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy