/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mobirent.datacollector;

import com.mobirent.abstracttags.DataClassable;
import com.mobirent.messageprocessor.XmlNode;

/**
 *
 * @author  Budai Attila
 */
public class Dvd implements DataClassable {

    private java.lang.String title;
    private String id;
    private String rentalPrice;

    public Dvd() {
    }

    public Dvd(String title, String id, String rentalPrice) {
        this.title = title;
        this.id = id;
        this.rentalPrice = rentalPrice;
    }

    public Dvd(XmlNode xmlNode) {
        XmlNode node;
       
        int ig = xmlNode.getSubNodes().size();
        for (int i = 0; i < ig; i++) {
            node = (XmlNode) xmlNode.getSubNodes().elementAt(i);
            if (node.getNodeName().equals("<t>")) {
                title = node.getValue();
            } else if (node.getNodeName().equals("<id>")) {
                id = node.getValue();
            } else if (node.getNodeName().equals("<rp>")) {
                rentalPrice = node.getValue();
            }
        }

    }

    public java.lang.String getTitle() {
        return title;
    }

    public void setTitle(java.lang.String val) {
        this.title = val;
    }

    public String reportIt() {
        return "<id>" + id + "</id><t>" + title + "</t><rp>" + rentalPrice + "</rp>";
    }

    public String toString() {
        return "Cím: " + title;
    }
}
