net.anotheria.anosite.gen.asfederateddata.data.GuardDefVO Maven / Gradle / Ivy
/**
********************************************************************************
*** GuardDefVO.java ***
*** generated by AnoSiteGenerator (ASG), Version: 2.6.3 ***
*** Copyright (C) 2005 - 2010 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.asfederateddata.data;
import net.anotheria.util.xml.XMLNode;
import net.anotheria.util.crypt.MD5Util;
import net.anotheria.asg.data.AbstractFederatedVO;
import net.anotheria.util.sorter.IComparable;
import net.anotheria.util.BasicComparable;
public class GuardDefVO extends AbstractFederatedVO implements GuardDef, IComparable{
private String id;
private String name;
private String clazz;
private String parameter1;
private String parameter2;
private String parameter3;
private String parameter4;
private String parameter5;
private String description;
private long lastupdatetimestamp;
public GuardDefVO(String anId){
id = anId;
}
public GuardDefVO(GuardDefVO toClone){
this.id = toClone.id;
copyAttributesFrom(toClone);
}
GuardDefVO(GuardDefBuilder builder){
id = "";
name = builder.name;
clazz = builder.clazz;
parameter1 = builder.parameter1;
parameter2 = builder.parameter2;
parameter3 = builder.parameter3;
parameter4 = builder.parameter4;
parameter5 = builder.parameter5;
description = builder.description;
}
public String getId(){
return id;
}
public long getLastUpdateTimestamp(){
return lastupdatetimestamp;
}
public void setLastUpdateTimestamp(long value){
lastupdatetimestamp = value;
}
public String getName(){
return name;
}
public void setName(String value){
name = value;
}
public String getClazz(){
return clazz;
}
public void setClazz(String value){
clazz = value;
}
public String getParameter1(){
return parameter1;
}
public void setParameter1(String value){
parameter1 = value;
}
public String getParameter2(){
return parameter2;
}
public void setParameter2(String value){
parameter2 = value;
}
public String getParameter3(){
return parameter3;
}
public void setParameter3(String value){
parameter3 = value;
}
public String getParameter4(){
return parameter4;
}
public void setParameter4(String value){
parameter4 = value;
}
public String getParameter5(){
return parameter5;
}
public void setParameter5(String value){
parameter5 = value;
}
public String getDescription(){
return description;
}
public void setDescription(String value){
description = value;
}
public String toString(){
String ret = "GuardDef ";
ret += "["+getId()+"] ";
ret += "name: "+getName();
ret += ", ";
ret += "clazz: "+getClazz();
ret += ", ";
ret += "parameter1: "+getParameter1();
ret += ", ";
ret += "parameter2: "+getParameter2();
ret += ", ";
ret += "parameter3: "+getParameter3();
ret += ", ";
ret += "parameter4: "+getParameter4();
ret += ", ";
ret += "parameter5: "+getParameter5();
ret += ", ";
ret += "description: "+getDescription();
return ret;
}
public GuardDef clone(){
return new GuardDefVO(this);
}
public void copyAttributesFrom(GuardDef toCopy){
this.name = toCopy.getName();
this.clazz = toCopy.getClazz();
this.parameter1 = toCopy.getParameter1();
this.parameter2 = toCopy.getParameter2();
this.parameter3 = toCopy.getParameter3();
this.parameter4 = toCopy.getParameter4();
this.parameter5 = toCopy.getParameter5();
this.description = toCopy.getDescription();
}
public Object getPropertyValue(String propertyName){
throw new RuntimeException("Not yet implemented.");
}
public XMLNode toXMLNode(){
return new XMLNode("not_imlpemented_fed_vo");
}
public int compareTo(GuardDef comparable){
return compareTo(comparable, GuardDefSortType.SORT_BY_DEFAULT);
}
public int compareTo(IComparable anotherComparable, int method){
GuardDefVO anotherDoc = (GuardDefVO) anotherComparable;
switch(method){
case GuardDefSortType.SORT_BY_ID:
return BasicComparable.compareString(getId(), anotherDoc.getId());
case GuardDefSortType.SORT_BY_NAME:
return BasicComparable.compareString(getName(), anotherDoc.getName());
case GuardDefSortType.SORT_BY_CLAZZ:
return BasicComparable.compareString(getClazz(), anotherDoc.getClazz());
case GuardDefSortType.SORT_BY_PARAMETER1:
return BasicComparable.compareString(getParameter1(), anotherDoc.getParameter1());
case GuardDefSortType.SORT_BY_PARAMETER2:
return BasicComparable.compareString(getParameter2(), anotherDoc.getParameter2());
case GuardDefSortType.SORT_BY_PARAMETER3:
return BasicComparable.compareString(getParameter3(), anotherDoc.getParameter3());
case GuardDefSortType.SORT_BY_PARAMETER4:
return BasicComparable.compareString(getParameter4(), anotherDoc.getParameter4());
case GuardDefSortType.SORT_BY_PARAMETER5:
return BasicComparable.compareString(getParameter5(), anotherDoc.getParameter5());
case GuardDefSortType.SORT_BY_DESCRIPTION:
return BasicComparable.compareString(getDescription(), anotherDoc.getDescription());
default:
throw new RuntimeException("Sort method "+method+" is not supported.");
}
}
public String getDefinedName(){
return "GuardDef";
}
public String getDefinedParentName(){
return "ASFederatedData";
}
public String getFootprint(){
StringBuilder footprint = new StringBuilder();
footprint.append(getName());
footprint.append(getClazz());
footprint.append(getParameter1());
footprint.append(getParameter2());
footprint.append(getParameter3());
footprint.append(getParameter4());
footprint.append(getParameter5());
footprint.append(getDescription());
return MD5Util.getMD5Hash(footprint);
}
public boolean equals(Object o){
return o == this || ((o instanceof GuardDefVO) && ((GuardDefVO)o).getId().equals(getId()));
}
}