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

net.anotheria.anosite.gen.asaction.data.ActionDefVO Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
/**
 ********************************************************************************
 *** ActionDefVO.java                                                         ***
 *** generated by AnoSiteGenerator (ASG), Version: 3.2.2                      ***
 *** Copyright (C) 2005 - 2023 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.asaction.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 ActionDefVO extends AbstractFederatedVO implements ActionDef, IComparable{

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

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

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

	ActionDefVO(ActionDefBuilder 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 = "ActionDef ";
		ret += "["+getId()+"] ";
		ret += "name: "+getName();
		ret += ", ";
		ret += "clazz: "+getClazz();
		return ret;
	}

	public ActionDef clone(){
		return new ActionDefVO(this);
	}

	public void copyAttributesFrom(ActionDef 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(ActionDef comparable){
		return compareTo(comparable, ActionDefSortType.SORT_BY_DEFAULT);
	}

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy