Skip to content

Commit faf4aee

Browse files
committed
Merge remote-tracking branch 'origin/DEVX-640-helper-method-from-Coco-product-to-import-API-product' into DEVX-640-helper-method-from-Coco-product-to-import-API-product
2 parents b5583ac + 3217682 commit faf4aee

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ cd4bb52247f964cdb924e28f32a6cd888d25ccea
3737
3fcbbbaa899976c15f805febd6864d70d260f830
3838
6f16c4a0cc66ed69ab5769595332d984c4abff9f
3939
8453de765b5576178f2e5d5ea6b6c1a5c6668027
40+
1f7b152196e439257d3307b749bbe9546b05fc66

commercetools/commercetools-importapi-utils/src/main/java/com/commercetools/sdk/CommonImportUtil.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.commercetools.importapi.models.common.*;
1919
import com.commercetools.importapi.models.customfields.CustomField;
2020

21-
import com.commercetools.importapi.models.productvariants.Attribute;
2221
import io.vrap.rmf.base.client.Builder;
2322

2423
public class CommonImportUtil {
@@ -130,9 +129,7 @@ static CustomField mapCustomField(Object value) {
130129
return CustomField.dateSetBuilder().value((ArrayList<LocalDate>) list).build();
131130
}
132131
if (list.get(0) instanceof ZonedDateTime) {
133-
return CustomField.dateTimeSetBuilder()
134-
.value((ArrayList<ZonedDateTime>) list)
135-
.build();
132+
return CustomField.dateTimeSetBuilder().value((ArrayList<ZonedDateTime>) list).build();
136133
}
137134
if (list.get(0) instanceof LocalTime) {
138135
return CustomField.timeSetBuilder().value((ArrayList<LocalTime>) list).build();
@@ -177,7 +174,7 @@ static CustomField mapCustomField(Object value) {
177174
return CustomField.moneySetBuilder()
178175
.value(list.stream()
179176
.map(v -> importApiTypedMoney((com.commercetools.api.models.common.TypedMoney) v,
180-
new TypedMoneyBuilder()).build())
177+
new TypedMoneyBuilder()).build())
181178
.collect(Collectors.toList()))
182179
.build();
183180
}

commercetools/commercetools-importapi-utils/src/main/java/com/commercetools/sdk/CustomerUtil.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
package com.commercetools.sdk;
33

4-
import static java.lang.Integer.parseInt;
5-
64
import java.util.List;
75

86
import com.commercetools.api.models.common.Address;
@@ -69,7 +67,8 @@ private AuthenticationMode toImportApiAuthenticationMode(
6967
}
7068

7169
public CustomerGroupKeyReference toCustomerGroupKeyReference(CustomerGroupReference customerGroup) {
72-
if (customerGroup == null) return null;
70+
if (customerGroup == null)
71+
return null;
7372
return CustomerGroupKeyReference.builder().key(keyResolverService.resolveKey(customerGroup)).build();
7473
}
7574

@@ -83,9 +82,11 @@ private List<Integer> getAddressesIds(List<Address> shippingAddresses) {
8382
}
8483

8584
private Integer getAddressesId(List<Address> addresses, String addressId) {
86-
if (addressId == null) return null;
85+
if (addressId == null)
86+
return null;
8787
for (int i = 0; i < addresses.size(); i++) {
88-
if (addressId.equals(addresses.get(i).getId())) return i;
88+
if (addressId.equals(addresses.get(i).getId()))
89+
return i;
8990
}
9091
return null;
9192
}

0 commit comments

Comments
 (0)