/*
* Copyright (C) 2011 Jason von Nieda <jason@vonnieda.org>
*
* This file is part of OpenPnP.
*
* OpenPnP is free software: you can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* OpenPnP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with OpenPnP. If not, see
* <http://www.gnu.org/licenses/>.
*
* For more information about OpenPnP visit http://openpnp.org
*/
package org.openpnp.model;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
public class Package implements Identifiable {
@Attribute
private String id;
@Attribute(required = false)
private String description;
@Element(required = false)
private Outline outline;
@Element(required = false)
private Footprint footprint;
private Package() {
this(null);
}
public Package(String id) {
this.id = id;
outline = new Outline();
footprint = new Footprint();
}
@Override
public String getId() {
return id;
}
/**
* Warning: This should never be called once the Package is added to the configuration. It
* should only be used when creating a new package.
*
* @param id
*/
public void setId(String id) {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Outline getOutline() {
return outline;
}
public void setOutline(Outline outline) {
this.outline = outline;
}
public Footprint getFootprint() {
return footprint;
}
public void setFootprint(Footprint footprint) {
this.footprint = footprint;
}
@Override
public String toString() {
return String.format("id %s", id);
}
}