001/**
002 * Copyright (c) 2014 Digi International Inc.,
003 * All rights not expressly granted are reserved.
004 *
005 * This Source Code Form is subject to the terms of the Mozilla Public
006 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
007 * You can obtain one at http://mozilla.org/MPL/2.0/.
008 *
009 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
010 * =======================================================================
011 */
012package com.digi.xbee.api.connection.serial;
013
014/**
015 * Helper class used to store serial port information.
016 */
017public class SerialPortInfo {
018        
019        // Variables.
020        private String portName;
021        private String portDescription;
022        
023        /**
024         * Class constructor. Instantiates a new {@code SerialPortInfo} object with
025         * the given parameters.
026         * 
027         * @param portName Name of the port.
028         * 
029         * @see #SerialPortInfo(String, String)
030         */
031        public SerialPortInfo(String portName) {
032                this(portName, null);
033        }
034        
035        /**
036         * Class constructor. Instantiates a new {@code SerialPortInfo} object with
037         * the given parameters.
038         * 
039         * @param portName Name of the port.
040         * @param portDescription Description of the port.
041         * 
042         * @see #SerialPortInfo(String)
043         */
044        public SerialPortInfo(String portName, String portDescription) {
045                this.portName = portName;
046                this.portDescription = portDescription;
047        }
048        
049        /**
050         * Returns the serial port name.
051         * 
052         * @return The serial port name.
053         * 
054         * @see #getPortDescription()
055         */
056        public String getPortName() {
057                return portName;
058        }
059        
060        /**
061         * Returns the serial port description.
062         * 
063         * @return The serial port description.
064         * 
065         * @see #getPortName()
066         */
067        public String getPortDescription() {
068                return portDescription;
069        }
070        
071        /**
072         * Sets the serial port description.
073         * 
074         * @param portDescription The serial port description.
075         * 
076         * @see #getPortDescription()
077         */
078        public void setPortDescription(String portDescription) {
079                this.portDescription = portDescription;
080        }
081}