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

net.anotheria.anosite.gen.assitedata.data.PageTemplateDocument Maven / Gradle / Ivy

There is a newer version: 4.1.2
Show newest version
/**
 ********************************************************************************
 *** PageTemplateDocument.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.assitedata.data;

import net.anotheria.asg.data.AbstractASGDocument;
import java.util.List;
import net.anotheria.anodoc.data.StringProperty;
import net.anotheria.util.crypt.MD5Util;
import net.anotheria.util.sorter.IComparable;
import net.anotheria.util.BasicComparable;

public class PageTemplateDocument extends AbstractASGDocument implements PageTemplate, IComparable{

	public PageTemplateDocument() {
		super("");
	}

	public PageTemplateDocument(String id){
		super(id);
	}

	public PageTemplateDocument(PageTemplateDocument toClone){
		super(toClone);
	}

	PageTemplateDocument(PageTemplateBuilder builder){
		super("");
		setName(builder.name);
		setMediaLinks(builder.mediaLinks);
		setScripts(builder.scripts);
		setC1first(builder.c1first);
		setC2first(builder.c2first);
		setC3first(builder.c3first);
		setC1last(builder.c1last);
		setC2last(builder.c2last);
		setC3last(builder.c3last);
		setMeta(builder.meta);
		setHeader(builder.header);
		setFooter(builder.footer);
		setLocalizations(builder.localizations);
		setDescription(builder.description);
		setLayout(builder.layout);
		setSite(builder.site);
	}

	public String getName(){
		return getString(PROP_NAME);
	}

	public void setName(String value){
		setString(PROP_NAME, value);
	}

	public List getMediaLinks(){
		return copyToStringList(getList(PROP_MEDIA_LINKS));
	}

	public void setMediaLinks(List value){
		setList(PROP_MEDIA_LINKS, copyFromStringList(value));
	}

	public List getScripts(){
		return copyToStringList(getList(PROP_SCRIPTS));
	}

	public void setScripts(List value){
		setList(PROP_SCRIPTS, copyFromStringList(value));
	}

	public List getC1first(){
		return copyToStringList(getList(PROP_C1FIRST));
	}

	public void setC1first(List value){
		setList(PROP_C1FIRST, copyFromStringList(value));
	}

	public List getC2first(){
		return copyToStringList(getList(PROP_C2FIRST));
	}

	public void setC2first(List value){
		setList(PROP_C2FIRST, copyFromStringList(value));
	}

	public List getC3first(){
		return copyToStringList(getList(PROP_C3FIRST));
	}

	public void setC3first(List value){
		setList(PROP_C3FIRST, copyFromStringList(value));
	}

	public List getC1last(){
		return copyToStringList(getList(PROP_C1LAST));
	}

	public void setC1last(List value){
		setList(PROP_C1LAST, copyFromStringList(value));
	}

	public List getC2last(){
		return copyToStringList(getList(PROP_C2LAST));
	}

	public void setC2last(List value){
		setList(PROP_C2LAST, copyFromStringList(value));
	}

	public List getC3last(){
		return copyToStringList(getList(PROP_C3LAST));
	}

	public void setC3last(List value){
		setList(PROP_C3LAST, copyFromStringList(value));
	}

	public List getMeta(){
		return copyToStringList(getList(PROP_META));
	}

	public void setMeta(List value){
		setList(PROP_META, copyFromStringList(value));
	}

	public List getHeader(){
		return copyToStringList(getList(PROP_HEADER));
	}

	public void setHeader(List value){
		setList(PROP_HEADER, copyFromStringList(value));
	}

	public List getFooter(){
		return copyToStringList(getList(PROP_FOOTER));
	}

	public void setFooter(List value){
		setList(PROP_FOOTER, copyFromStringList(value));
	}

	public List getLocalizations(){
		return copyToStringList(getList(PROP_LOCALIZATIONS));
	}

	public void setLocalizations(List value){
		setList(PROP_LOCALIZATIONS, copyFromStringList(value));
	}

	public String getDescription(){
		return getString(PROP_DESCRIPTION);
	}

	public void setDescription(String value){
		setString(PROP_DESCRIPTION, value);
	}

	public String getLayout(){
		return getString(LINK_PROP_LAYOUT);
	}

	public void setLayout(String value){
		setString(LINK_PROP_LAYOUT, value);
	}

	public String getSite(){
		return getString(LINK_PROP_SITE);
	}

	public void setSite(String value){
		setString(LINK_PROP_SITE, value);
	}


	public String toString(){
		String ret = "PageTemplate ";
		ret += "["+getId()+"] ";
		ret += "name: "+getName();
		ret += ", ";
		ret += "mediaLinks: "+getMediaLinks();
		ret += ", ";
		ret += "scripts: "+getScripts();
		ret += ", ";
		ret += "c1first: "+getC1first();
		ret += ", ";
		ret += "c2first: "+getC2first();
		ret += ", ";
		ret += "c3first: "+getC3first();
		ret += ", ";
		ret += "c1last: "+getC1last();
		ret += ", ";
		ret += "c2last: "+getC2last();
		ret += ", ";
		ret += "c3last: "+getC3last();
		ret += ", ";
		ret += "meta: "+getMeta();
		ret += ", ";
		ret += "header: "+getHeader();
		ret += ", ";
		ret += "footer: "+getFooter();
		ret += ", ";
		ret += "localizations: "+getLocalizations();
		ret += ", ";
		ret += "description: "+getDescription();
		return ret;
	}

	public int getMediaLinksSize(){
		return getList(PROP_MEDIA_LINKS).size();
	}

	public void addMediaLinksElement(String mediaLinks){
		getListPropertyAnyCase(PROP_MEDIA_LINKS).add(new StringProperty("" + mediaLinks, mediaLinks));
	} //method

	public void removeMediaLinksElement(int index){
		getListProperty(PROP_MEDIA_LINKS).remove(index);
	} //method

	public void swapMediaLinksElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_MEDIA_LINKS).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_MEDIA_LINKS).get(index2)).getString();
		((StringProperty)getList(PROP_MEDIA_LINKS).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_MEDIA_LINKS).get(index2)).setString(tmp1);
	} //method

	public String getMediaLinksElement(int index){
		StringProperty p = (StringProperty)getList(PROP_MEDIA_LINKS).get(index);
		return p.getString();
	} //method

	public int getScriptsSize(){
		return getList(PROP_SCRIPTS).size();
	}

	public void addScriptsElement(String scripts){
		getListPropertyAnyCase(PROP_SCRIPTS).add(new StringProperty("" + scripts, scripts));
	} //method

	public void removeScriptsElement(int index){
		getListProperty(PROP_SCRIPTS).remove(index);
	} //method

	public void swapScriptsElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_SCRIPTS).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_SCRIPTS).get(index2)).getString();
		((StringProperty)getList(PROP_SCRIPTS).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_SCRIPTS).get(index2)).setString(tmp1);
	} //method

	public String getScriptsElement(int index){
		StringProperty p = (StringProperty)getList(PROP_SCRIPTS).get(index);
		return p.getString();
	} //method

	public int getC1firstSize(){
		return getList(PROP_C1FIRST).size();
	}

	public void addC1firstElement(String box){
		getListPropertyAnyCase(PROP_C1FIRST).add(new StringProperty("" + box, box));
	} //method

	public void removeC1firstElement(int index){
		getListProperty(PROP_C1FIRST).remove(index);
	} //method

	public void swapC1firstElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C1FIRST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C1FIRST).get(index2)).getString();
		((StringProperty)getList(PROP_C1FIRST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C1FIRST).get(index2)).setString(tmp1);
	} //method

	public String getC1firstElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C1FIRST).get(index);
		return p.getString();
	} //method

	public int getC2firstSize(){
		return getList(PROP_C2FIRST).size();
	}

	public void addC2firstElement(String box){
		getListPropertyAnyCase(PROP_C2FIRST).add(new StringProperty("" + box, box));
	} //method

	public void removeC2firstElement(int index){
		getListProperty(PROP_C2FIRST).remove(index);
	} //method

	public void swapC2firstElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C2FIRST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C2FIRST).get(index2)).getString();
		((StringProperty)getList(PROP_C2FIRST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C2FIRST).get(index2)).setString(tmp1);
	} //method

	public String getC2firstElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C2FIRST).get(index);
		return p.getString();
	} //method

	public int getC3firstSize(){
		return getList(PROP_C3FIRST).size();
	}

	public void addC3firstElement(String box){
		getListPropertyAnyCase(PROP_C3FIRST).add(new StringProperty("" + box, box));
	} //method

	public void removeC3firstElement(int index){
		getListProperty(PROP_C3FIRST).remove(index);
	} //method

	public void swapC3firstElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C3FIRST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C3FIRST).get(index2)).getString();
		((StringProperty)getList(PROP_C3FIRST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C3FIRST).get(index2)).setString(tmp1);
	} //method

	public String getC3firstElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C3FIRST).get(index);
		return p.getString();
	} //method

	public int getC1lastSize(){
		return getList(PROP_C1LAST).size();
	}

	public void addC1lastElement(String box){
		getListPropertyAnyCase(PROP_C1LAST).add(new StringProperty("" + box, box));
	} //method

	public void removeC1lastElement(int index){
		getListProperty(PROP_C1LAST).remove(index);
	} //method

	public void swapC1lastElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C1LAST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C1LAST).get(index2)).getString();
		((StringProperty)getList(PROP_C1LAST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C1LAST).get(index2)).setString(tmp1);
	} //method

	public String getC1lastElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C1LAST).get(index);
		return p.getString();
	} //method

	public int getC2lastSize(){
		return getList(PROP_C2LAST).size();
	}

	public void addC2lastElement(String box){
		getListPropertyAnyCase(PROP_C2LAST).add(new StringProperty("" + box, box));
	} //method

	public void removeC2lastElement(int index){
		getListProperty(PROP_C2LAST).remove(index);
	} //method

	public void swapC2lastElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C2LAST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C2LAST).get(index2)).getString();
		((StringProperty)getList(PROP_C2LAST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C2LAST).get(index2)).setString(tmp1);
	} //method

	public String getC2lastElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C2LAST).get(index);
		return p.getString();
	} //method

	public int getC3lastSize(){
		return getList(PROP_C3LAST).size();
	}

	public void addC3lastElement(String box){
		getListPropertyAnyCase(PROP_C3LAST).add(new StringProperty("" + box, box));
	} //method

	public void removeC3lastElement(int index){
		getListProperty(PROP_C3LAST).remove(index);
	} //method

	public void swapC3lastElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_C3LAST).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_C3LAST).get(index2)).getString();
		((StringProperty)getList(PROP_C3LAST).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_C3LAST).get(index2)).setString(tmp1);
	} //method

	public String getC3lastElement(int index){
		StringProperty p = (StringProperty)getList(PROP_C3LAST).get(index);
		return p.getString();
	} //method

	public int getMetaSize(){
		return getList(PROP_META).size();
	}

	public void addMetaElement(String box){
		getListPropertyAnyCase(PROP_META).add(new StringProperty("" + box, box));
	} //method

	public void removeMetaElement(int index){
		getListProperty(PROP_META).remove(index);
	} //method

	public void swapMetaElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_META).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_META).get(index2)).getString();
		((StringProperty)getList(PROP_META).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_META).get(index2)).setString(tmp1);
	} //method

	public String getMetaElement(int index){
		StringProperty p = (StringProperty)getList(PROP_META).get(index);
		return p.getString();
	} //method

	public int getHeaderSize(){
		return getList(PROP_HEADER).size();
	}

	public void addHeaderElement(String box){
		getListPropertyAnyCase(PROP_HEADER).add(new StringProperty("" + box, box));
	} //method

	public void removeHeaderElement(int index){
		getListProperty(PROP_HEADER).remove(index);
	} //method

	public void swapHeaderElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_HEADER).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_HEADER).get(index2)).getString();
		((StringProperty)getList(PROP_HEADER).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_HEADER).get(index2)).setString(tmp1);
	} //method

	public String getHeaderElement(int index){
		StringProperty p = (StringProperty)getList(PROP_HEADER).get(index);
		return p.getString();
	} //method

	public int getFooterSize(){
		return getList(PROP_FOOTER).size();
	}

	public void addFooterElement(String box){
		getListPropertyAnyCase(PROP_FOOTER).add(new StringProperty("" + box, box));
	} //method

	public void removeFooterElement(int index){
		getListProperty(PROP_FOOTER).remove(index);
	} //method

	public void swapFooterElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_FOOTER).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_FOOTER).get(index2)).getString();
		((StringProperty)getList(PROP_FOOTER).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_FOOTER).get(index2)).setString(tmp1);
	} //method

	public String getFooterElement(int index){
		StringProperty p = (StringProperty)getList(PROP_FOOTER).get(index);
		return p.getString();
	} //method

	public int getLocalizationsSize(){
		return getList(PROP_LOCALIZATIONS).size();
	}

	public void addLocalizationsElement(String localization){
		getListPropertyAnyCase(PROP_LOCALIZATIONS).add(new StringProperty("" + localization, localization));
	} //method

	public void removeLocalizationsElement(int index){
		getListProperty(PROP_LOCALIZATIONS).remove(index);
	} //method

	public void swapLocalizationsElement(int index1, int index2){
		String tmp1, tmp2;
		tmp1 = ((StringProperty)getList(PROP_LOCALIZATIONS).get(index1)).getString();
		tmp2 = ((StringProperty)getList(PROP_LOCALIZATIONS).get(index2)).getString();
		((StringProperty)getList(PROP_LOCALIZATIONS).get(index1)).setString(tmp2);
		((StringProperty)getList(PROP_LOCALIZATIONS).get(index2)).setString(tmp1);
	} //method

	public String getLocalizationsElement(int index){
		StringProperty p = (StringProperty)getList(PROP_LOCALIZATIONS).get(index);
		return p.getString();
	} //method


	public int compareTo(PageTemplate comparable){
		return compareTo(comparable, PageTemplateSortType.SORT_BY_DEFAULT);
	}

	public int compareTo(IComparable anotherComparable, int method){
		PageTemplateDocument anotherDoc = (PageTemplateDocument) anotherComparable;
		switch(method){
			case PageTemplateSortType.SORT_BY_ID:
				return BasicComparable.compareString(getId(), anotherDoc.getId());
			case PageTemplateSortType.SORT_BY_NAME:
				return BasicComparable.compareString(getName(), anotherDoc.getName());
			case PageTemplateSortType.SORT_BY_DESCRIPTION:
				return BasicComparable.compareString(getDescription(), anotherDoc.getDescription());
			case PageTemplateSortType.SORT_BY_LAYOUT:
				return BasicComparable.compareString(getLayout(), anotherDoc.getLayout());
			case PageTemplateSortType.SORT_BY_SITE:
				return BasicComparable.compareString(getSite(), anotherDoc.getSite());
			default:
				throw new RuntimeException("Sort method "+method+" is not supported.");
		}
	}

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

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

	public String getFootprint(){
		StringBuilder footprint = new StringBuilder();
		footprint.append(getName());
		footprint.append(getMediaLinks());
		footprint.append(getScripts());
		footprint.append(getC1first());
		footprint.append(getC2first());
		footprint.append(getC3first());
		footprint.append(getC1last());
		footprint.append(getC2last());
		footprint.append(getC3last());
		footprint.append(getMeta());
		footprint.append(getHeader());
		footprint.append(getFooter());
		footprint.append(getLocalizations());
		footprint.append(getDescription());
		footprint.append(getLayout());
		footprint.append(getSite());
		return MD5Util.getMD5Hash(footprint);
	}

	public boolean equals(Object o){
		return o == this || ((o instanceof PageTemplateDocument) && ((PageTemplateDocument)o).getId().equals(getId()));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy