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
|
* @author Andreas Gudian
|
||||||
*/
|
*/
|
||||||
public class MappingOptions {
|
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 Map<String, List<Mapping>> mappings;
|
||||||
private IterableMapping iterableMapping;
|
private IterableMapping iterableMapping;
|
||||||
private MapMapping mapMapping;
|
private MapMapping mapMapping;
|
||||||
@ -62,8 +69,7 @@ public class MappingOptions {
|
|||||||
* @return empty mapping options
|
* @return empty mapping options
|
||||||
*/
|
*/
|
||||||
public static MappingOptions empty() {
|
public static MappingOptions empty() {
|
||||||
return new MappingOptions( Collections.<String, List<Mapping>>emptyMap(), null, null, null,
|
return EMPTY;
|
||||||
Collections.<ValueMapping>emptyList(), false );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user