All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.anosite.gen.asfederateddata.data.BoxHandlerDefVO Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
/**
 ********************************************************************************
 *** BoxHandlerDefVO.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 BoxHandlerDefVO extends AbstractFederatedVO implements BoxHandlerDef, IComparable{

	private String id;
	private String name;
	private String clazz;
	private long lastupdatetimestamp;

	public BoxHandlerDefVO(String anId){
		id = anId;
	}

	public BoxHandlerDefVO(BoxHandlerDefVO toClone){
		this.id = toClone.id;
		copyAttributesFrom(toClone);
	}

	BoxHandlerDefVO(BoxHandlerDefBuilder builder){
		id = "";
		name = builder.name;
		clazz = builder.clazz;
	}

	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 toString(){
		String ret = "BoxHandlerDef ";
		ret += "["+getId()+"] ";
		ret += "name: "+getName();
		ret += ", ";
		ret += "clazz: "+getClazz();
		return ret;
	}

	public BoxHandlerDef clone(){
		return new BoxHandlerDefVO(this);
	}

	public void copyAttributesFrom(BoxHandlerDef toCopy){
		this.name = toCopy.getName();
		this.clazz = toCopy.getClazz();
	}

	public Object getPropertyValue(String propertyName){
		throw new RuntimeException("Not yet implemented.");
	}

	public XMLNode toXMLNode(){
		return new XMLNode("not_imlpemented_fed_vo");
	}

	public int compareTo(BoxHandlerDef comparable){
		return compareTo(comparable, BoxHandlerDefSortType.SORT_BY_DEFAULT);
	}

	public int compareTo(IComparable anotherComparable, int method){
		BoxHandlerDefVO anotherDoc = (BoxHandlerDefVO) anotherComparable;
		switch(method){
			case BoxHandlerDefSortType.SORT_BY_ID:
				return BasicComparable.compareString(getId(), anotherDoc.getId());
			case BoxHandlerDefSortType.SORT_BY_NAME:
				return BasicComparable.compareString(getName(), anotherDoc.getName());
			case BoxHandlerDefSortType.SORT_BY_CLAZZ:
				return BasicComparable.compareString(getClazz(), anotherDoc.getClazz());
			default:
				throw new RuntimeException("Sort method "+method+" is not supported.");
		}
	}

	public String getDefinedName(){
		return "BoxHandlerDef";
	}

	public String getDefinedParentName(){
		return "ASFederatedData";
	}

	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 BoxHandlerDefVO) && ((BoxHandlerDefVO)o).getId().equals(getId()));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy