[issue #2221] simplified configuration for @Singular-generated plural form nullchecks.

This commit is contained in:
Reinier Zwitserloot committed 2020-01-31 06:33:33 +01:00
1 parent d31182c438
commit c42bfbae39
85 files changed
+517 -643

No files matched your search

@@ -46,15 +46,16 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withWomen(java.util.Map<? extends K, ? extends V> women) {
if (women != null) {
if (this.women$key == null) {
this.women$key = new java.util.ArrayList<K>();
this.women$value = new java.util.ArrayList<V>();
}
for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet()) {
this.women$key.add($lombokEntry.getKey());
this.women$value.add($lombokEntry.getValue());
}
if (women == null) {
throw new NullPointerException("women cannot be null");
}
if (this.women$key == null) {
this.women$key = new java.util.ArrayList<K>();
this.women$value = new java.util.ArrayList<V>();
}
for (java.util.Map.Entry<? extends K, ? extends V> $lombokEntry : women.entrySet()) {
this.women$key.add($lombokEntry.getKey());
this.women$value.add($lombokEntry.getValue());
}
return this;
}
@@ -78,15 +79,16 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withMen(java.util.Map<? extends K, ? extends Number> men) {
if (men != null) {
if (this.men$key == null) {
this.men$key = new java.util.ArrayList<K>();
this.men$value = new java.util.ArrayList<Number>();
}
for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet()) {
this.men$key.add($lombokEntry.getKey());
this.men$value.add($lombokEntry.getValue());
}
if (men == null) {
throw new NullPointerException("men cannot be null");
}
if (this.men$key == null) {
this.men$key = new java.util.ArrayList<K>();
this.men$value = new java.util.ArrayList<Number>();
}
for (java.util.Map.Entry<? extends K, ? extends Number> $lombokEntry : men.entrySet()) {
this.men$key.add($lombokEntry.getKey());
this.men$value.add($lombokEntry.getValue());
}
return this;
}
@@ -142,15 +144,16 @@ class BuilderSingularMapsWithSetterPrefix<K, V> {
}
@SuppressWarnings("all")
public BuilderSingularMapsWithSetterPrefix.BuilderSingularMapsWithSetterPrefixBuilder<K, V> withStringMap(java.util.Map<? extends String, ? extends V> stringMap) {
if (stringMap != null) {
if (this.stringMap$key == null) {
this.stringMap$key = new java.util.ArrayList<String>();
this.stringMap$value = new java.util.ArrayList<V>();
}
for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet()) {
this.stringMap$key.add($lombokEntry.getKey());
this.stringMap$value.add($lombokEntry.getValue());
}
if (stringMap == null) {
throw new NullPointerException("stringMap cannot be null");
}
if (this.stringMap$key == null) {
this.stringMap$key = new java.util.ArrayList<String>();
this.stringMap$value = new java.util.ArrayList<V>();
}
for (java.util.Map.Entry<? extends String, ? extends V> $lombokEntry : stringMap.entrySet()) {
this.stringMap$key.add($lombokEntry.getKey());
this.stringMap$value.add($lombokEntry.getValue());
}
return this;
}