package com.acme.structure.component;

import com.acme.structure.BaseEntity;
import com.acme.structure.vo.BaseWrapper;

public class BaseRow
{
    private BaseEntity baseEntity;
    private RowProperties rowProperties;
    private BaseWrapper baseWrapper;
    private Object dataObject;

    public BaseRow()
    {
        this(null, new RowProperties());
    }

    public BaseRow(BaseWrapper baseWrapper)
    {
        setBaseWrapper(baseWrapper);
        setRowProperties(new RowProperties());
    }

    public BaseRow(Object object, boolean dummyObjectApplied)
    {
        setDataObject(object);
        setRowProperties(new RowProperties());
    }

    public BaseRow(BaseEntity baseEntity, RowProperties customRowProperties)
    {
        setBaseEntity(baseEntity);
        setRowProperties(customRowProperties);
    }

    public BaseRow(BaseEntity baseEntity)
    {
        this(baseEntity, new RowProperties());
        if (!getBaseEntity().isPersisted())
            getRowProperties().setUpdateable(true);
    }

    public void setBaseEntity(BaseEntity baseEntity)
    {
        this.baseEntity = baseEntity;
    }

    public BaseEntity getBaseEntity()
    {
        return baseEntity;
    }

    public void setRowProperties(RowProperties rowProperties)
    {
        this.rowProperties = rowProperties;
    }

    public RowProperties getRowProperties()
    {
        return rowProperties;
    }

    public int compareTo(Object o)
    {
        return 0;
    }

    public void setBaseWrapper(BaseWrapper baseWrapper)
    {
        this.baseWrapper = baseWrapper;
    }

    public BaseWrapper getBaseWrapper()
    {
        return baseWrapper;
    }

    public void setDataObject(Object dataObject)
    {
        this.dataObject = dataObject;
    }

    public Object getDataObject()
    {
        return dataObject;
    }

    public void setRowPropertiesUpdateable(boolean updateable)
    {
        getRowProperties().setUpdateable(updateable);
    }
}
