Top Description Constructors Methods
com.univocity.parsers.conversions

public Class CharacterConversion

extends ObjectConversion<Character>
Class Inheritance
Imports
com.univocity.parsers.common.*

Converts Strings to Characters and vice versa
Author
Univocity Software Pty Ltd - [email protected]

Constructor Summary

AccessConstructor and Description
public
CharacterConversion()

Creates a Conversion from String to Character with default values to return when the input is null.

public
CharacterConversion(Character
default Character value to be returned when the input String is null. Used when ObjectConversion#execute(String) is invoked.
valueIfStringIsNull
,
String
default String value to be returned when a Character input is null. Used when revert(Character) is invoked.
valueIfObjectIsNull
)

Creates a Conversion from String to Character with default values to return when the input is null.

Method Summary

Modifier and TypeMethod and Description
protected Character
fromString(String
The String to be converted to T
input
)

Implements abstract com.univocity.parsers.conversions.ObjectConversion.fromString.

Converts a String to a Character.
Inherited from com.univocity.parsers.conversions.ObjectConversion:
executefromInputgetValueIfObjectIsNullgetValueIfStringIsNullrevertsetValueIfObjectIsNullsetValueIfStringIsNullundo

Constructor Detail

CharacterConversionback to summary
public CharacterConversion()

Creates a Conversion from String to Character with default values to return when the input is null. This default constructor assumes the output of a conversion should be null when input is null

CharacterConversionback to summary
public CharacterConversion(Character valueIfStringIsNull, String valueIfObjectIsNull)

Creates a Conversion from String to Character with default values to return when the input is null.

Parameters
valueIfStringIsNull:Character

default Character value to be returned when the input String is null. Used when ObjectConversion#execute(String) is invoked.

valueIfObjectIsNull:String

default String value to be returned when a Character input is null. Used when revert(Character) is invoked.

Method Detail

fromStringback to summary
protected Character fromString(String input)

Implements abstract com.univocity.parsers.conversions.ObjectConversion.fromString.

Converts a String to a Character.

Parameters
input:String

Doc from com.univocity.parsers.conversions.ObjectConversion.fromString.

The String to be converted to T

Returns:Character

Doc from com.univocity.parsers.conversions.ObjectConversion.fromString.

an instance of T, converted from the String input.

Annotations
@Override
Exceptions
IllegalArgumentException:
if the input String length is not equal to 1, then an IllegalArgumentException is thrown.