package xyz.veronie.bgg.result; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; public class ThingMetaData implements java.io.Serializable { private static final long serialVersionUID = -5268898737006538509L; private int id; private String name; private String imgURL; private String thumbURL; private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this); public ThingMetaData(int id, String name, String imgURL, String thumURL) { this.setId(id); this.setName(name); this.setImgURL(imgURL); this.setThumbURL(thumURL); } public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) { propertyChangeSupport.addPropertyChangeListener(propertyName, listener); } public void removePropertyChangeListener(PropertyChangeListener listener) { propertyChangeSupport.removePropertyChangeListener(listener); } public int getId() { return id; } public void setId(int id) { propertyChangeSupport.firePropertyChange("id", this.id, this.id = id); } public String getName() { return name; } public void setName(String name) { propertyChangeSupport.firePropertyChange("name", this.name, this.name = name); } public String getImgURL() { return imgURL; } public void setImgURL(String imgURL) { propertyChangeSupport.firePropertyChange("img", this.imgURL, this.imgURL = imgURL); } public String getThumbURL() { return thumbURL; } public void setThumbURL(String thumbURL) { propertyChangeSupport.firePropertyChange("thumb", this.thumbURL, this.thumbURL = thumbURL); } @Override public String toString() { return String.valueOf(id); } }