mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
Use static instance instead of always initialising the empty MappingOptions
This commit is contained in:
parent
c751100272
commit
8d8d1c37f2
@ -38,6 +38,13 @@ import org.mapstruct.ap.internal.util.FormattingMessager;
|
||||
* @author Andreas Gudian
|
||||
*/
|
||||
public class MappingOptions {
|
||||
private static final MappingOptions EMPTY = new MappingOptions( Collections.<String, List<Mapping>>emptyMap(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
Collections.<ValueMapping>emptyList(),
|
||||
false
|
||||
);
|
||||
private Map<String, List<Mapping>> mappings;
|
||||
private IterableMapping iterableMapping;
|
||||
private MapMapping mapMapping;
|
||||
@ -62,8 +69,7 @@ public class MappingOptions {
|
||||
* @return empty mapping options
|
||||
*/
|
||||
public static MappingOptions empty() {
|
||||
return new MappingOptions( Collections.<String, List<Mapping>>emptyMap(), null, null, null,
|
||||
Collections.<ValueMapping>emptyList(), false );
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user