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

com.adyen.model.FraudResult Maven / Gradle / Ivy

There is a newer version: 28.4.0
Show newest version
/**
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Java API Library
 *
 * Copyright (c) 2017 Adyen B.V.
 * This file is open source and available under the MIT license.
 * See the LICENSE file for more info.
 */
package com.adyen.model;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;

/**
 * FraudResult
 */
public class FraudResult {
    @SerializedName("accountScore")
    private Integer accountScore = null;

    @SerializedName("results")
    private List results = new ArrayList();

    public FraudResult accountScore(Integer accountScore) {
        this.accountScore = accountScore;
        return this;
    }

    /**
     * the total fraud score generated by the risk checks
     *
     * @return accountScore
     **/
    public Integer getAccountScore() {
        return accountScore;
    }

    public void setAccountScore(Integer accountScore) {
        this.accountScore = accountScore;
    }

    public FraudResult results(List results) {
        this.results = results;
        return this;
    }

    public List getResults() {
        return results;
    }

    public void setResults(List results) {
        this.results = results;
    }

    /**
     * the result of the individual risk checks
     *
     * @return results
     **/
    public List getFraudCheckResults() {
        List fraudCheckResults = new ArrayList<>();
        for (FraudCheckResultContainer fraudCheckResultContainer : results) {
            fraudCheckResults.add(fraudCheckResultContainer.getFraudCheckResult());
        }
        return fraudCheckResults;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        FraudResult fraudResult = (FraudResult) o;
        return Objects.equals(this.accountScore, fraudResult.accountScore) &&
                Objects.equals(this.results, fraudResult.results);
    }

    @Override
    public int hashCode() {
        return Objects.hash(accountScore, results);
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class FraudResult {\n");

        sb.append("    accountScore: ").append(toIndentedString(accountScore)).append("\n");
        sb.append("    results: ").append(toIndentedString(results)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy