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

net.anotheria.anosite.gen.assitedata.bean.NaviItemListItemBeanSortType Maven / Gradle / Ivy

There is a newer version: 4.1.1
Show newest version
/**
 ********************************************************************************
 *** NaviItemListItemBeanSortType.java                                        ***
 *** generated by AnoSiteGenerator (ASG), Version: 2.6.10                     ***
 *** Copyright (C) 2005 - 2020 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.bean;

import net.anotheria.util.sorter.SortType;


public class NaviItemListItemBeanSortType extends SortType{

	// Generated by: class net.anotheria.asg.generator.view.action.ModuleBeanGenerator.generateListItemSortType

	public static final int SORT_BY_ID = 1;
	public static final int SORT_BY_NAMEEN = 2;
	public static final int SORT_BY_NAMEDE = 3;
	public static final int SORT_BY_EXTERNALLINK = 4;
	public static final int SORT_BY_INTERNALLINK = 5;
	public static final int SORT_BY_CLASSNAME = 6;
	public static final int SORT_BY_SUBNAVI = 7;
	public static final int SORT_BY_POPUP = 8;
	public static final int SORT_BY_DEFAULT = SORT_BY_NAMEEN;

	public NaviItemListItemBeanSortType(){
		super(SORT_BY_DEFAULT);
	}

	public NaviItemListItemBeanSortType(int method){
		super(method);
	}

	public NaviItemListItemBeanSortType(int method, boolean order){
		super(method, order);
	}

	public static int name2method(String name){
		if ("id".equals(name))
			return SORT_BY_ID;
		if ("nameEN".equals(name))
			return SORT_BY_NAMEEN;
		if ("nameDE".equals(name))
			return SORT_BY_NAMEDE;
		if ("externalLink".equals(name))
			return SORT_BY_EXTERNALLINK;
		if ("internalLink".equals(name))
			return SORT_BY_INTERNALLINK;
		if ("className".equals(name))
			return SORT_BY_CLASSNAME;
		if ("subNavi".equals(name))
			return SORT_BY_SUBNAVI;
		if ("popup".equals(name))
			return SORT_BY_POPUP;
		throw new RuntimeException("Unknown sort type name: "+name);
	}

	public static String method2name(int method){
		switch (method){
			case SORT_BY_ID:
				return "id";
			case SORT_BY_NAMEEN:
				return "nameEN";
			case SORT_BY_NAMEDE:
				return "nameDE";
			case SORT_BY_EXTERNALLINK:
				return "externalLink";
			case SORT_BY_INTERNALLINK:
				return "internalLink";
			case SORT_BY_CLASSNAME:
				return "className";
			case SORT_BY_SUBNAVI:
				return "subNavi";
			case SORT_BY_POPUP:
				return "popup";
		}
		throw new RuntimeException("Unknown sort type method: "+method);
	}

	public String getMethodAndOrderCode(){
		return method2name(getSortBy())+"_"+(getSortOrder() ? "ASC":"DESC");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy