org.bidib.wizard.api.model.MacroRef Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bidibwizard-api Show documentation
Show all versions of bidibwizard-api Show documentation
jBiDiB BiDiB Wizard API POM
The newest version!
package org.bidib.wizard.api.model;
import com.jgoodies.binding.beans.Model;
public class MacroRef extends Model {
private static final long serialVersionUID = 1L;
public static final String PROPERTY_LABEL = "label";
private Integer id;
private String label;
/**
* Creates a new instance of MacroRef. The MacroRef stores the id of a macro.
*/
public MacroRef() {
this.id = 0;
}
/**
* Creates a new instance of MacroRef. The MacroRef stores the id of a macro.
*
* @param id
* the {@code id} of the mapped macro
*/
public MacroRef(Integer id) {
this.id = id;
}
/**
* @return the {@code id} of the mapped macro
*/
public Integer getId() {
return id;
}
/**
* Set the the {@code id} of the mapped macro.
*
* @param id
* the {@code id} of the mapped macro
*/
public void setId(Integer id) {
this.id = id;
}
/**
* @return the label of the aspect
*/
public String getLabel() {
return label;
}
/**
* @param label
* the label of the aspect
*/
public void setLabel(String label) {
String oldValue = this.label;
this.label = label;
firePropertyChange(PROPERTY_LABEL, oldValue, label);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
MacroRef other = (MacroRef) obj;
if (id == null) {
if (other.id != null)
return false;
}
else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "MacroRef, id: " + id;
}
}