All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.client.shop.SignInResult Maven / Gradle / Ivy

There is a newer version: 0.72.1
Show newest version
package io.sphere.client.shop;

import io.sphere.client.shop.model.Cart;
import io.sphere.client.shop.model.Customer;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/** Result returned by {@link io.sphere.client.shop.SphereClient SphereClient's} sign-in and sign-up methods.
 *  Contains a customer and their active cart (if such cart exists, null otherwise). */
public class SignInResult {
    private Customer customer;
    private Cart cart;

    // for JSON deserializer
    private SignInResult() { }

    /** The existing customer. */
    @Nonnull public Customer getCustomer() { return customer; }
    /** Customer's cart or null if no cart exists. */
    @Nullable public Cart getCart() { return cart; }

    @Override
    public String toString() {
        return "SignInResult{" +
                "customer=" + customer +
                ", cart=" + cart +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy