awips2/edexOsgi/com.raytheon.uf.common.parameter/src/com/raytheon/uf/common/parameter/ParameterConverter.java
Nate Jensen 8a31b5edf5 Issue fill in units on GridRecords created from URIs
Change-Id: Ic7c1594c1442d8463c5050bdefb434995ffc7f8a

Former-commit-id: 1d38804eb2 [formerly 3719c41d2b] [formerly 71b4227061] [formerly 1d38804eb2 [formerly 3719c41d2b] [formerly 71b4227061] [formerly 7cea97ab15 [formerly 71b4227061 [formerly 949d132cf3260db5f75ea665f21601ab91440958]]]]
Former-commit-id: 7cea97ab15
Former-commit-id: e8ca9729eb [formerly 5bf1554597] [formerly 4cf3887df369f38b75f0a2c9f9f7949057e50e42 [formerly 6bdbfb7e1a]]
Former-commit-id: 0fc7bbac68e600996cc014bbf843e66d5484e6e9 [formerly 66cd43313a]
Former-commit-id: ad7a69f2e3
2014-05-06 12:26:21 -05:00

59 lines
1.8 KiB
Java

/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.parameter;
import com.raytheon.uf.common.dataplugin.annotations.DataURIFieldConverter;
import com.raytheon.uf.common.parameter.lookup.ParameterLookup;
/**
* A DataURIFieldConverter that ensures that a String parameter abbreviation
* will be looked up to potentially contain all the fields.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 6, 2014 2060 njensen Initial creation
*
* </pre>
*
* @author njensen
* @version 1.0
*/
public class ParameterConverter implements DataURIFieldConverter<Parameter> {
@Override
public String toString(Parameter field) {
return field.getAbbreviation();
}
@Override
public Parameter fromString(String string) {
Parameter p = ParameterLookup.getInstance().getParameter(string);
if (p == null) {
p = new Parameter(string);
}
return p;
}
}