Class ParameterProvidedMethods
- java.lang.Object
-
- org.mapstruct.ap.internal.model.source.ParameterProvidedMethods
-
public class ParameterProvidedMethods extends java.lang.ObjectProvides access to theSourceMethods that are provided byContextparameters of aMethodand maintains the relationship between those methods and their originating parameter.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classParameterProvidedMethods.Builder
-
Field Summary
Fields Modifier and Type Field Description private static ParameterProvidedMethodsEMPTYprivate java.util.Map<SourceMethod,Parameter>methodToProvidingParameterprivate java.util.Map<Parameter,java.util.List<SourceMethod>>parameterToProvidedMethods
-
Constructor Summary
Constructors Modifier Constructor Description privateParameterProvidedMethods(java.util.Map<Parameter,java.util.List<SourceMethod>> parameterToProvidedMethods)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ParameterProvidedMethods.Builderbuilder()static ParameterProvidedMethodsempty()java.util.List<SourceMethod>getAllProvidedMethodsInParameterOrder(java.util.List<Parameter> orderedParameters)ParametergetParameterForProvidedMethod(Method method)booleanisEmpty()
-
-
-
Field Detail
-
EMPTY
private static final ParameterProvidedMethods EMPTY
-
parameterToProvidedMethods
private final java.util.Map<Parameter,java.util.List<SourceMethod>> parameterToProvidedMethods
-
methodToProvidingParameter
private final java.util.Map<SourceMethod,Parameter> methodToProvidingParameter
-
-
Constructor Detail
-
ParameterProvidedMethods
private ParameterProvidedMethods(java.util.Map<Parameter,java.util.List<SourceMethod>> parameterToProvidedMethods)
-
-
Method Detail
-
getAllProvidedMethodsInParameterOrder
public java.util.List<SourceMethod> getAllProvidedMethodsInParameterOrder(java.util.List<Parameter> orderedParameters)
- Parameters:
orderedParameters- The parameters of which the provided methods are to be returned.- Returns:
- The methods provided by the given parameters in the order as defined by the parameter list, with the methods of each parameter ordered based on their definition in that parameter's type.
-
getParameterForProvidedMethod
public Parameter getParameterForProvidedMethod(Method method)
- Parameters:
method- The method for which the defining parameter is to be returned.- Returns:
- The Parameter on which's type the provided method is defined, or
nullif the method was not defined on one of the tracked parameters.
-
isEmpty
public boolean isEmpty()
- Returns:
true, if no methods are provided by the tracked parameters or no parameters are tracked at all.
-
builder
public static ParameterProvidedMethods.Builder builder()
-
empty
public static ParameterProvidedMethods empty()
-
-