All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.univocity.parsers.conversions.Conversion Maven / Gradle / Ivy

Go to download

univocity's open source parsers for processing different text formats using a consistent API

There is a newer version: 2.9.1
Show newest version
/*******************************************************************************
 * Copyright 2014 uniVocity Software Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.univocity.parsers.conversions;

import com.univocity.parsers.common.processor.*;

/**
 * The interface that defines the conversion from one type of value to another, and vice versa.
 *
 * uniVocity-parsers provides a set of default conversions for usage with
 * {@link ObjectRowProcessor} and {@link ObjectRowWriterProcessor}.
 *
 * Annotations in package {@link com.univocity.parsers.annotations} are associated with different Conversion implementations in {@link com.univocity.parsers.conversions}.
 *
 * @param  The input type to be converted to the output type O
 * @param  The type of outputs produced by a conversion applied to the an input I
 *
 * @see com.univocity.parsers.common.processor.ObjectRowProcessor
 * @see com.univocity.parsers.common.processor.ObjectRowWriterProcessor
 *
 * @author uniVocity Software Pty Ltd - [email protected]
 */
public interface Conversion {

	/**
	 * Converts a value of type I to a value of type O
	 * @param input the input of type I to be converted to an object of type O
	 * @return the conversion result.
	 */
	public O execute(I input);

	/**
	 * Converts a value of type O to a value of type I
	 * @param input the input of type O to be converted to an object of type I
	 * @return the conversion result
	 */
	public I revert(O input);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy