/**
* Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite
* contributors
*
* This file is part of EvoSuite.
*
* EvoSuite is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3.0 of the License, or
* (at your option) any later version.
*
* EvoSuite is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>.
*/
package com.examples.with.different.packagename.testcarver;
import java.util.Date;
/**
* {@link DateTimeConverter} implementation that handles conversion to
* and from <b>java.util.Date</b> objects.
* <p>
* This implementation can be configured to handle conversion either
* by using a Locale's default format or by specifying a set of format
* patterns (note, there is no default String conversion for Date).
* See the {@link DateTimeConverter} documentation for further details.
* <p>
* Can be configured to either return a <i>default value</i> or throw a
* <code>ConversionException</code> if a conversion error occurs.
*
* @version $Revision: 640131 $
* @since 1.8.0
*/
public final class DateConverter extends DateTimeConverter {
/**
* Construct a <b>java.util.Date</b> <i>Converter</i> that throws
* a <code>ConversionException</code> if an error occurs.
*/
public DateConverter() {
super();
}
/**
* Construct a <b>java.util.Date</b> <i>Converter</i> that returns
* a default value if an error occurs.
*
* @param defaultValue The default value to be returned
* if the value to be converted is missing or an error
* occurs converting the value.
*/
public DateConverter(Object defaultValue) {
super(defaultValue);
}
/**
* Return the default type this <code>Converter</code> handles.
*
* @return The default type this <code>Converter</code> handles.
*/
protected Class getDefaultType() {
return Date.class;
}
}