public class DefaultConversionPath<F,T> extends java.lang.Object implements ConversionPath<F,T>
Modifier and Type | Method and Description |
---|---|
<X> ConversionPath<F,X> |
append(ConversionStep<T,X> following)
Create a new ConversionPath by adding the given ConversionStep.
|
boolean |
contains(java.lang.Class<?> from)
Test if this ConversionPath contains a conversion
from the given Class.
|
T |
convert(F from,
ArooaConverter converter)
Convert the given object using the ConversionPath.
|
java.lang.Class<F> |
getFromClass()
Get the from Class of this ConversionPath.
|
<X,Y> ConversionStep<X,Y> |
getStep(int step)
Get the conversion step for the given index.
|
java.lang.Class<T> |
getToClass()
Get the to Class of this ConversionPath.
|
static <X> ConversionPath<X,X> |
instance(java.lang.Class<X> start) |
int |
length()
Get the number of Steps in this ConversionPath.
|
<X> ConversionPath<X,T> |
prepend(ConversionStep<X,F> preceeding)
Create a new ConversionPath by prepending the given ConversionStep.
|
java.lang.String |
toString() |
public static <X> ConversionPath<X,X> instance(java.lang.Class<X> start)
public <X> ConversionPath<F,X> append(ConversionStep<T,X> following)
ConversionPath
append
in interface ConversionPath<F,T>
public <X> ConversionPath<X,T> prepend(ConversionStep<X,F> preceeding)
ConversionPath
prepend
in interface ConversionPath<F,T>
public java.lang.Class<F> getFromClass()
ConversionPath
getFromClass
in interface ConversionPath<F,T>
public java.lang.Class<T> getToClass()
ConversionPath
getToClass
in interface ConversionPath<F,T>
public int length()
ConversionPath
length
in interface ConversionPath<F,T>
public boolean contains(java.lang.Class<?> from)
ConversionPath
contains
in interface ConversionPath<F,T>
public <X,Y> ConversionStep<X,Y> getStep(int step)
ConversionPath
getStep
in interface ConversionPath<F,T>
step
- The index.public T convert(F from, ArooaConverter converter) throws ConversionFailedException
convert
in interface ConversionPath<F,T>
from
- ConvertletException
ConversionFailedException
public java.lang.String toString()
toString
in class java.lang.Object