net.anotheria.anosite.gen.aswizarddata.data.WizardHandlerDefDocument Maven / Gradle / Ivy
The newest version!
/**
********************************************************************************
*** WizardHandlerDefDocument.java ***
*** generated by AnoSiteGenerator (ASG), Version: 4.2.2 ***
*** Copyright (C) 2005 - 2025 Anotheria.net, www.anotheria.net ***
*** All Rights Reserved. ***
********************************************************************************
*** Don't edit this code, if you aren't sure ***
*** that you do exactly know what you are doing! ***
*** It's better to invest time in the generator, as into the generated code. ***
********************************************************************************
*/
package net.anotheria.anosite.gen.aswizarddata.data;
import net.anotheria.asg.data.AbstractASGDocument;
import net.anotheria.util.crypt.MD5Util;
import net.anotheria.util.sorter.IComparable;
import net.anotheria.util.BasicComparable;
public class WizardHandlerDefDocument extends AbstractASGDocument implements WizardHandlerDef, IComparable{
public WizardHandlerDefDocument() {
super("");
}
public WizardHandlerDefDocument(String id){
super(id);
}
public WizardHandlerDefDocument(WizardHandlerDefDocument toClone){
super(toClone);
}
WizardHandlerDefDocument(WizardHandlerDefBuilder builder){
super("");
setName(builder.name);
setClazz(builder.clazz);
}
public String getName(){
return getString(PROP_NAME);
}
public void setName(String value){
setString(PROP_NAME, value);
}
public String getClazz(){
return getString(PROP_CLAZZ);
}
public void setClazz(String value){
setString(PROP_CLAZZ, value);
}
public String toString(){
String ret = "WizardHandlerDef ";
ret += "["+getId()+"] ";
ret += "name: "+getName();
ret += ", ";
ret += "clazz: "+getClazz();
return ret;
}
public int compareTo(WizardHandlerDef comparable){
return compareTo(comparable, WizardHandlerDefSortType.SORT_BY_DEFAULT);
}
public int compareTo(IComparable anotherComparable, int method){
WizardHandlerDefDocument anotherDoc = (WizardHandlerDefDocument) anotherComparable;
switch(method){
case WizardHandlerDefSortType.SORT_BY_ID:
return BasicComparable.compareString(getId(), anotherDoc.getId());
case WizardHandlerDefSortType.SORT_BY_NAME:
return BasicComparable.compareString(getName(), anotherDoc.getName());
case WizardHandlerDefSortType.SORT_BY_CLAZZ:
return BasicComparable.compareString(getClazz(), anotherDoc.getClazz());
default:
throw new RuntimeException("Sort method "+method+" is not supported.");
}
}
public String getDefinedName(){
return "WizardHandlerDef";
}
public String getDefinedParentName(){
return "ASWizardData";
}
public String getFootprint(){
StringBuilder footprint = new StringBuilder();
footprint.append(getName());
footprint.append(getClazz());
return MD5Util.getMD5Hash(footprint);
}
public boolean equals(Object o){
return o == this || ((o instanceof WizardHandlerDefDocument) && ((WizardHandlerDefDocument)o).getId().equals(getId()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy