public class TypeSystem extends Object
Constructor | Description |
---|---|
TypeSystem(Set<Conversion<?,?>> conversions,
Set<Type<?>> types) |
Initializes the type system with the given conversions and types.
|
Modifier and Type | Method | Description |
---|---|---|
ConversionResult |
getConcretePath(boolean implicit,
Type<?> source,
Type<?> target) |
Retrieve the list of conversions to be applied to convert a concrete type source into to (a possibly non-concrete) target.
|
Optional<Type<?>> |
leastUpperBound(boolean implicit,
Set<Type<?>> types) |
Get the least upper bound given a set of types, either for implicit or explicit conversions.
|
Type |
parse(String id,
List<Object> arguments) |
Parse a type given its id, and a list of specialization
|
public TypeSystem(Set<Conversion<?,?>> conversions, Set<Type<?>> types)
conversions
- Supported conversionstypes
- Additional types to consider (useful when no conversion exists for such a type)public ConversionResult getConcretePath(boolean implicit, Type<?> source, Type<?> target)
If the conversion is successful, the returned ConversionResult
will contain the conversion path along with the resolved, concrete result type.
implicit
- Use only implicit conversionssource
- Source typetarget
- Target typeConfigurationException
- If an inconsistent conversion configuration was foundpublic Optional<Type<?>> leastUpperBound(boolean implicit, Set<Type<?>> types)
implicit
- If true, use the implicit type conversionstypes
- Input elementsCopyright © 2019. All rights reserved.