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

com.konduto.sdk.models.KondutoTravel Maven / Gradle / Ivy

Go to download

Easily integrate with Konduto (https://konduto.com), a fraud prevention service.

There is a newer version: 2.17.4
Show newest version
package com.konduto.sdk.models;

import com.google.gson.annotations.SerializedName;
import com.konduto.sdk.annotations.Required;

import java.util.Collection;

/**
 * KondutoTravel model.
 *
 * @see Konduto API Spec
 */
public class KondutoTravel extends KondutoModel {
    @Required
    @SerializedName(value = "type")
    private KondutoTravelType travelType;
    @Required
    @SerializedName(value = "departure")
    private KondutoTravelLeg departureLeg;
    @SerializedName(value = "return")
    private KondutoTravelLeg returnLeg;
    @Required
    private Collection passengers;

    /** Constructors */
    public KondutoTravel(){}

    /**
     * Fluent constructor implementation
     *
     * @param attributeName  the attribute name (e.g greeting)
     * @param attributeValue the attribute value (e.g "Hello")
     * @return a new instance
     * @see Fluent interface article
     */
    @Override
    public KondutoTravel with(String attributeName, Object attributeValue) {
        return (KondutoTravel) super.with(attributeName, attributeValue);
    }

    /** Equals and hashCode */
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        KondutoTravel that = (KondutoTravel) o;

        if (travelType != that.travelType) return false;
        if (!departureLeg.equals(that.departureLeg)) return false;
        if (returnLeg != null ? !returnLeg.equals(that.returnLeg) : that.returnLeg != null) return false;
        return passengers.equals(that.passengers);

    }

    @Override
    public int hashCode() {
        int result = travelType.hashCode();
        result = 31 * result + departureLeg.hashCode();
        result = 31 * result + (returnLeg != null ? returnLeg.hashCode() : 0);
        result = 31 * result + passengers.hashCode();
        return result;
    }

    /** Getters/setters */

    public KondutoTravelType getTravelType() {
        return travelType;
    }

    public void setTravelType(KondutoTravelType travelType) {
        this.travelType = travelType;
    }

    public KondutoTravelLeg getDepartureLeg() {
        return departureLeg;
    }

    public void setDepartureLeg(KondutoTravelLeg departureLeg) {
        this.departureLeg = departureLeg;
    }

    public KondutoTravelLeg getReturnLeg() {
        return returnLeg;
    }

    public void setReturnLeg(KondutoTravelLeg returnLeg) {
        this.returnLeg = returnLeg;
    }

    public Collection getPassengers() {
        return passengers;
    }

    public void setPassengers(Collection passengers) {
        this.passengers = passengers;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy