Extending classes must implement a proper String to T conversion in ObjectConversion#fromString(String)
This abstract class provides default results for conversions when the input is null.
| Modifier and Type | Field and Description |
|---|---|
| private O | |
| private I |
| Access | Constructor and Description |
|---|---|
| public | NullConversion()
Creates a Conversion from an object to another object of a different type, with default values to return when the input is null. |
| public | NullConversion(O
default value of type O to be returned when the input object I is null. Used when valueOnNullInput, I NullConversion#execute(Object) is invoked.default value of type I to be returned when an input of type I is null. Used when valueOnNullOutput)NullConversion#revert(Object) is invoked.Creates a Conversion from an object to another object of a different type, with default values to return when the input is null. |
| Modifier and Type | Method and Description |
|---|---|
| public O | Returns: the conversion result, or the value ofNullConversion#valueOnNullInput if the input object is null.the input value of type I to be converted to an object of type O input)Implements com. |
| protected abstract O | Returns: an instance of O, converted from the I input.The object of type I to be converted to O input)Creates an instance of O from a I object |
| public O | Returns: the default value of type O used when converting from a null Ireturns a default value of type O to be returned when the input of type I is null. |
| public I | Returns: the default I instance used when converting from a null Oreturns default instance of I to be returned when an input of type O is null. |
| public I | Returns: the conversion result, or the value ofNullConversion#valueOnNullOutput if the input object is null.the input of type O to be converted to an output I input)Implements com. |
| public void | setValueOnNullInput(O
the default value of type T when converting from a null input valueOnNullInput)defines the default value of type O which should be returned when |
| public void | setValueOnNullOutput(I
a default value of type I when converting from a null input valueOnNullOutput)defines the default value of type I which should be returned when |
| protected abstract I | Returns: the conversion resultthe input object to be converted to I input)Converts a value of type O back to I. |
| valueOnNullInput | back to summary |
|---|---|
| private O valueOnNullInput | |
| valueOnNullOutput | back to summary |
|---|---|
| private I valueOnNullOutput | |
| NullConversion | back to summary |
|---|---|
| public NullConversion() Creates a Conversion from an object to another object of a different type, with default values to return when the input is null. The default constructor assumes the output of a conversion should be null when input is null | |
| NullConversion | back to summary |
|---|---|
| public NullConversion(O valueOnNullInput, I valueOnNullOutput) Creates a Conversion from an object to another object of a different type, with default values to return when the input is null.
| |
| execute | back to summary |
|---|---|
| public O execute(I input) Implements com. Converts the given instance of type I to an instance of O
| |
| fromInput | back to summary |
|---|---|
| protected abstract O fromInput(I input) Creates an instance of O from a I object
| |
| getValueOnNullInput | back to summary |
|---|---|
| public O getValueOnNullInput() returns a default value of type O to be returned when the input of type I is null. Used when
| |
| getValueOnNullOutput | back to summary |
|---|---|
| public I getValueOnNullOutput() returns default instance of I to be returned when an input of type O is null. Used when
| |
| revert | back to summary |
|---|---|
| public I revert(O input) Implements com. Converts a value of type O back to a value of type I
| |
| setValueOnNullInput | back to summary |
|---|---|
| public void setValueOnNullInput(O valueOnNullInput) defines the default value of type O which should be returned when
| |
| setValueOnNullOutput | back to summary |
|---|---|
| public void setValueOnNullOutput(I valueOnNullOutput) defines the default value of type I which should be returned when
| |
| undo | back to summary |
|---|---|
| protected abstract I undo(O input) Converts a value of type O back to I.
| |