001/*
002 *  Copyright 2015 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.forms.content.data;
017
018import java.util.Date;
019import java.util.List;
020
021import org.ametys.core.user.UserIdentity;
022
023/**
024 * User entry.
025 */
026public class UserEntry
027{
028    /** The entry id. */
029    protected int _id;
030    
031    /** The entry submission date. */
032    protected Date _creationDate;
033    
034    /** The user identity */
035    protected UserIdentity _userIdentity;
036    
037    /** The entry values. */
038    protected List<FieldValue> _values;
039    
040    /** The workflow id */
041    protected Integer _workflowId;
042    
043    /**
044     * Constructor with parameters.
045     * @param id the id of the user entry
046     * @param creationDate the creation date of the user entry
047     * @param values the values of the user entry
048     * @param workflowId the id of the workflow of this user entry
049     * @param userIdentity the user identity. Can be null.
050     */
051    public UserEntry(int id, Date creationDate, List<FieldValue> values, Integer workflowId, UserIdentity userIdentity)
052    {
053        this._id = id;
054        this._creationDate = creationDate;
055        this._values = values;
056        this._workflowId = workflowId;
057        this._userIdentity = userIdentity;
058    }
059
060    /**
061     * Get the id.
062     * @return the id
063     */
064    public int getId()
065    {
066        return _id;
067    }
068
069    /**
070     * Set the id.
071     * @param id the id to set
072     */
073    public void setId(int id)
074    {
075        this._id = id;
076    }
077
078    /**
079     * Get the creationDate.
080     * @return the creationDate
081     */
082    public Date getCreationDate()
083    {
084        return _creationDate;
085    }
086
087    /**
088     * Set the creationDate.
089     * @param creationDate the creationDate to set
090     */
091    public void setCreationDate(Date creationDate)
092    {
093        this._creationDate = creationDate;
094    }
095
096    /**
097     * Get the values.
098     * @return the values
099     */
100    public List<FieldValue> getValues()
101    {
102        return _values;
103    }
104
105    /**
106     * Set the values.
107     * @param values the values to set
108     */
109    public void setValues(List<FieldValue> values)
110    {
111        this._values = values;
112    }
113    
114    /**
115     * Set the workflow id of this entry
116     * @param workflowId the id of the workflow of this entry
117     */
118    public void setWorkflowId(Integer workflowId)
119    {
120        this._workflowId = workflowId;
121    }
122    
123    /**
124     * Get the workflow id of this user entry
125     * @return the workflow id of this entry
126     */
127    public Integer getWorkflowId()
128    {
129        return _workflowId;
130    }
131    
132    /**
133     * Get the user identity of the entry
134     * @return the user identity. Can be null.
135     */
136    public UserIdentity getUserIdentity()
137    {
138        return _userIdentity;
139    }
140    
141}