001/*******************************************************************************
002 * Crown Copyright (c) 2006 - 2014, Copyright (c) 2006 - 2014 Kestral Computing P/L.
003 * All rights reserved. This program and the accompanying materials
004 * are made available under the terms of the Eclipse Public License v1.0
005 * which accompanies this distribution, and is available at
006 * http://www.eclipse.org/legal/epl-v10.html
007 * 
008 * Contributors:
009 *    Kestral Computing P/L - initial implementation
010 *******************************************************************************/
011
012package org.hl7.fhir.utilities.ucum;
013
014public class Value {
015
016        private String unit;
017        
018        private String unitUC;
019        
020        private Decimal value;
021        
022        private String text;
023
024        /**
025         * @param unit
026         * @param unitUC
027         * @param value
028         */
029        public Value(String unit, String unitUC, Decimal value) {
030                super();
031                this.unit = unit;
032                this.unitUC = unitUC;
033                this.value = value;
034        }
035
036        /**
037         * @return the unit
038         */
039        public String getUnit() {
040                return unit;
041        }
042
043        /**
044         * @param unit the unit to set
045         */
046        public void setUnit(String unit) {
047                this.unit = unit;
048        }
049
050        /**
051         * @return the unitUC
052         */
053        public String getUnitUC() {
054                return unitUC;
055        }
056
057        /**
058         * @param unitUC the unitUC to set
059         */
060        public void setUnitUC(String unitUC) {
061                this.unitUC = unitUC;
062        }
063
064        /**
065         * @return the value
066         */
067        public Decimal getValue() {
068                return value;
069        }
070
071        /**
072         * @param value the value to set
073         */
074        public void setValue(Decimal value) {
075                this.value = value;
076        }
077
078        /**
079         * @return the text
080         */
081        public String getText() {
082                return text;
083        }
084
085        /**
086         * @param text the text to set
087         */
088        public void setText(String text) {
089                this.text = text;
090        }
091
092        public String getDescription() {
093                if (value == null)
094                        return unit;
095                return value.toString()+unit;
096        }
097        
098        
099}