001/*
002 *  Copyright 2017 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.glpi;
017
018/**
019 * Information about a Glpi ticket (id, title, status)
020 */
021public class GlpiTicket
022{
023    /** The id of ticket */
024    private int _id;
025
026    /** The title of ticket */
027    private String _title;
028
029    /** The status id of ticket */
030    private int _status;
031
032    private int _type;
033    private String _category;
034    
035    /**
036     * Create a {@link GlpiTicket}
037     * @param id The id of ticket
038     * @param title The title of ticket
039     * @param status The status id of ticket
040     */
041    public GlpiTicket(int id, String title, int status)
042    {
043        this(id,  title, status, -1, null);  
044    }
045    
046    /**
047     * Create a {@link GlpiTicket}
048     * @param id The id of ticket
049     * @param title The title of ticket
050     * @param status The status id of ticket
051     * @param type The type
052     * @param category The category
053     */
054    public GlpiTicket(int id, String title, int status, int type, String category)
055    {
056        _id = id;
057        _title = title;
058        _status = status;
059        _category = category;
060        _type = type;    
061    }
062
063    /**
064     * Get the id of ticket
065     * @return The id of ticket
066     */
067    public int getId()
068    {
069        return _id;
070    }
071
072    /**
073     * Set the id of ticket
074     * @param id The id of ticket to set
075     */
076    public void setId(int id)
077    {
078        this._id = id;
079    }
080
081    /**
082     * Get the title of ticket
083     * @return The title of ticket
084     */
085    public String getTitle()
086    {
087        return _title;
088    }
089
090    /**
091     * Set the title of ticket
092     * 
093     * @param title The title of ticket to set
094     */
095    public void setTitle(String title)
096    {
097        this._title = title;
098    }
099
100    /**
101     * Get the status id of ticket
102     * @return The status of ticket
103     */
104    public int getStatusId()
105    {
106        return _status;
107    }
108
109    /**
110     * Set the status id of ticket
111     * @param status The status id of ticket to set
112     */
113    public void setStatus(int status)
114    {
115        this._status = status;
116    }
117    
118    /**
119     * Get the category of ticket
120     * @return the category
121     */
122    public String getCategory()
123    {
124        return _category;
125    }
126
127    /**
128     * Set the category of ticket
129     * @param category the category
130     */
131    public void setCategory(String category)
132    {
133        this._category = category;
134    }
135    
136    /**
137     * Get the type of ticket
138     * @return the type or -1 if not defined
139     */
140    public int getType()
141    {
142        return _type;
143    }
144
145    /**
146     * Set the type of ticket
147     * @param type the type
148     */
149    public void setType(int type)
150    {
151        this._type = type;
152    }
153}