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

cl.transbank.onepay.model.Item Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
package cl.transbank.onepay.model;

import lombok.*;
import lombok.experimental.Accessors;

import java.util.UUID;

@ToString
public class Item implements Cloneable {
    @Getter private final transient String id;
    @Getter @Setter @Accessors(chain = true) private String description;
    @Getter @Setter @Accessors(chain = true) private int quantity;
    @Getter @Setter @Accessors(chain = true) private int amount;
    @Getter @Setter @Accessors(chain = true) private String additionalData;
    @Getter @Setter @Accessors(chain = true) private long expire;

    public Item() {
        super();
        this.id = UUID.randomUUID().toString();
    }

    public Item(String description, int quantity, int amount, String additionalData, long expire) {
        this();
        this.description = description;
        this.quantity = quantity;
        this.amount = amount;
        this.additionalData = additionalData;
        this.expire = expire;
    }

    public Item clone() {
        try {
            return (Item) super.clone();
        } catch (CloneNotSupportedException e) {
            return null;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy