001/*
002 *  Copyright 2012 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.core.version;
017
018import java.util.Date;
019
020/**
021 * Represents a given version of a component, given its unique name and build date.<br>
022 * It is used in the administrator area to display the versions of the main used components.
023 */
024public final class Version
025{
026    private String _name;
027    private String _version;
028    private Date _date;
029    
030    /**
031     * Constructor
032     * @param name the name of the component
033     * @param version the name of this version
034     * @param date the build date of this version. May be null.
035     */
036    public Version(String name, String version, Date date)
037    {
038        _name = name;
039        _version = version;
040        _date = date;
041    }
042    
043    /**
044     * Returns the name of the component
045     * @return the name of the component
046     */
047    public String getName()
048    {
049        return _name;
050    }
051    
052    /**
053     * Returns the name of this version
054     * @return the name of this version
055     */
056    public String getVersion()
057    {
058        return _version;
059    }
060    
061    /**
062     * Returns the build date of this version
063     * @return the build date of this version
064     */
065    public Date getDate()
066    {
067        return _date;
068    }
069}