1 /** 2 * Copyright 2014 Internet2 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 /* 17 * Copyright (C) 2003, 2004 Joe Walnes. 18 * Copyright (C) 2006, 2007 XStream Committers. 19 * All rights reserved. 20 * 21 * The software in this package is published under the terms of the BSD 22 * style license a copy of which has been included with this distribution in 23 * the LICENSE.txt file. 24 * 25 * Created on 26. September 2003 by Joe Walnes 26 */ 27 package edu.internet2.middleware.grouperClientExt.com.thoughtworks.xstream.converters.basic; 28 29 /** 30 * Converts a float primitive or java.lang.Float wrapper to 31 * a String. 32 * 33 * @author Joe Walnes 34 */ 35 public class FloatConverter extends AbstractSingleValueConverter { 36 37 public boolean canConvert(Class type) { 38 return type.equals(float.class) || type.equals(Float.class); 39 } 40 41 public Object fromString(String str) { 42 return Float.valueOf(str); 43 } 44 45 }