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

com.gocart.model.orders.response.ShippingMethod Maven / Gradle / Ivy

Go to download

A java client library designed to make it easier for merchants to integrate with GoCart API

The newest version!
package com.gocart.model.orders.response;

import com.gocart.utils.JsonUtil;

import java.util.Objects;
import java.util.Optional;

/**
 * Defines the fields for a shipping method
 */
public class ShippingMethod {
    private String name;
    private int price;
    private String externalId;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getExternalId() {
        return externalId;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShippingMethod that = (ShippingMethod) o;
        return price == that.price && Objects.equals(name, that.name) && Objects.equals(externalId, that.externalId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, price, externalId);
    }

    @Override
    public String toString() {
        Optional string = JsonUtil.toString(this);
        return string.orElse(null);
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy