![JAR search and dependency download from the Maven repository](/logo.png)
com.dft.api.shopify.model.ShopifyCustomers Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of shopify-admin-rest Show documentation
Show all versions of shopify-admin-rest Show documentation
Shopify Admin REST API using JDK 11 and Reactive Programming
The newest version!
package com.dft.api.shopify.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ShopifyCustomers {
private final Map customerIdToShopifyCustomer;
public ShopifyCustomers(final List shopifyCustomers) {
customerIdToShopifyCustomer = new HashMap<>(shopifyCustomers.size());
shopifyCustomers.stream().forEach(shopifyCustomer -> {
customerIdToShopifyCustomer.put(shopifyCustomer.getId(), shopifyCustomer);
});
}
public ShopifyCustomer get(final String customerId) {
return customerIdToShopifyCustomer.get(customerId);
}
public List values() {
return new ArrayList<>(customerIdToShopifyCustomer.values());
}
// public List getAddresses() {
// final Collection shopifyCustomers = customerIdToShopifyCustomer.values();
// final List shopifyAddresses = new ArrayList<>(shopifyCustomers.size());
// for (ShopifyCustomer shopifyCustomer : shopifyCustomers) {
// shopifyAddresses.addAll(shopifyCustomer.getAddresses());
// }
// return shopifyAddresses;
// }
public int size() {
return customerIdToShopifyCustomer.size();
}
public boolean containsKey(final String customerId) {
return customerIdToShopifyCustomer.containsKey(customerId);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy