Class StaticDomainFunctionTypeResolvers.NthArgumentDomainFunctionTypeResolver
- java.lang.Object
-
- com.blazebit.domain.runtime.model.StaticDomainFunctionTypeResolvers.NthArgumentDomainFunctionTypeResolver
-
- All Implemented Interfaces:
DomainFunctionTypeResolver
,DomainSerializer<DomainFunctionTypeResolver>
,Serializable
- Direct Known Subclasses:
StaticDomainFunctionTypeResolvers.FirstArgumentDomainFunctionTypeResolver
,StaticDomainFunctionTypeResolvers.FourthArgumentDomainFunctionTypeResolver
,StaticDomainFunctionTypeResolvers.SecondArgumentDomainFunctionTypeResolver
,StaticDomainFunctionTypeResolvers.ThirdArgumentDomainFunctionTypeResolver
- Enclosing class:
- StaticDomainFunctionTypeResolvers
public static class StaticDomainFunctionTypeResolvers.NthArgumentDomainFunctionTypeResolver extends Object implements DomainFunctionTypeResolver, DomainSerializer<DomainFunctionTypeResolver>, Serializable
A resolver that returns the nth argument type as result type.- Since:
- 2.0.3
- Author:
- Christian Beikov
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NthArgumentDomainFunctionTypeResolver(int index)
Creates a new domain function type resolver that resolves the result type to the argument type at the given index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DomainType
resolveType(DomainModel domainModel, DomainFunction function, Map<DomainFunctionArgument,DomainType> argumentTypes)
Resolves the domain function return type for the given argument type assignments.<T> T
serialize(DomainModel domainModel, DomainFunctionTypeResolver element, Class<T> targetType, String format, Map<String,Object> properties)
Serializes the domain model to the given target type with the given format.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.blazebit.domain.spi.DomainSerializer
canSerialize, serialize
-
-
-
-
Constructor Detail
-
NthArgumentDomainFunctionTypeResolver
public NthArgumentDomainFunctionTypeResolver(int index)
Creates a new domain function type resolver that resolves the result type to the argument type at the given index.- Parameters:
index
- The argument index of the argument type to resolve the result type to
-
-
Method Detail
-
resolveType
public DomainType resolveType(DomainModel domainModel, DomainFunction function, Map<DomainFunctionArgument,DomainType> argumentTypes)
Description copied from interface:DomainFunctionTypeResolver
Resolves the domain function return type for the given argument type assignments.- Specified by:
resolveType
in interfaceDomainFunctionTypeResolver
- Parameters:
domainModel
- The domain modelfunction
- The domain functionargumentTypes
- The domain function argument types- Returns:
- the resolved function return type
-
serialize
public <T> T serialize(DomainModel domainModel, DomainFunctionTypeResolver element, Class<T> targetType, String format, Map<String,Object> properties)
Description copied from interface:DomainSerializer
Serializes the domain model to the given target type with the given format.- Specified by:
serialize
in interfaceDomainSerializer<DomainFunctionTypeResolver>
- Type Parameters:
T
- The target type- Parameters:
domainModel
- The domain modelelement
- The domain element to serializetargetType
- The target typeformat
- The serialization formatproperties
- Serialization properties- Returns:
- The serialized form or
null
if the type or format is unsupported
-
-