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

com.github.triceo.robozonky.remote.Loan Maven / Gradle / Ivy

/*
 *
 *  * Copyright 2016 Lukáš Petrovický
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  *
 *  *      http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 * /
 */
package com.github.triceo.robozonky.remote;

import java.math.BigDecimal;
import java.time.Instant;
import java.util.Collection;
import javax.xml.bind.annotation.XmlElement;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

public class Loan implements BaseEntity {

    private boolean topped, covered, published;
    private int id, termInMonths, investmentsCount, questionsCount, userId;
    private double amount, remainingInvestment;
    private String name, story, nickName;
    private BigDecimal interestRate;
    private Instant datePublished, deadline;
    private Rating rating;
    private Collection photos;
    private BigDecimal investmentRate;
    private MyInvestment myInvestment;
    private MainIncomeType mainIncomeType;
    private Region region;
    private Purpose purpose;

    @XmlElement
    public MyInvestment getMyInvestment() {
        return myInvestment;
    }

    @XmlElement
    public MainIncomeType getMainIncomeType() {
        return mainIncomeType;
    }

    @XmlElement
    public BigDecimal getInvestmentRate() {
        return investmentRate;
    }

    @XmlElement
    @JsonDeserialize(using = RegionDeserializer.class)
    public Region getRegion() {
        return region;
    }

    @XmlElement
    @JsonDeserialize(using = PurposeDeserializer.class)
    public Purpose getPurpose() {
        return purpose;
    }

    @XmlElement
    public int getId() {
        return id;
    }

    @XmlElement
    public String getName() {
        return name;
    }

    @XmlElement
    public String getStory() {
        return story;
    }

    @XmlElement
    public String getNickName() {
        return nickName;
    }

    @XmlElement
    public int getTermInMonths() {
        return termInMonths;
    }

    @XmlElement
    public BigDecimal getInterestRate() {
        return interestRate;
    }

    @XmlElement
    public Rating getRating() {
        return rating;
    }

    @XmlElement
    public boolean isTopped() {
        return topped;
    }

    @XmlElement
    public double getAmount() {
        return amount;
    }

    @XmlElement
    public double getRemainingInvestment() {
        return remainingInvestment;
    }

    @XmlElement
    public boolean isCovered() {
        return covered;
    }

    @XmlElement
    public boolean isPublished() {
        return published;
    }

    @XmlElement
    @JsonDeserialize(using = InstantDeserializer.class)
    public Instant getDatePublished() {
        return datePublished;
    }

    @XmlElement
    @JsonDeserialize(using = InstantDeserializer.class)
    public Instant getDeadline() {
        return deadline;
    }

    @XmlElement
    public int getInvestmentsCount() {
        return investmentsCount;
    }

    @XmlElement
    public int getQuestionsCount() {
        return questionsCount;
    }

    @XmlElement
    public Collection getPhotos() {
        return photos;
    }

    @XmlElement
    public int getUserId() {
        return userId;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Loan{");
        sb.append("id=").append(id);
        sb.append(", termInMonths=").append(termInMonths);
        sb.append(", userId=").append(userId);
        sb.append(", amount=").append(amount);
        sb.append(", rating=").append(rating);
        sb.append('}');
        return sb.toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy