net.anotheria.anosite.gen.asblogdata.bean.PostListItemBean Maven / Gradle / Ivy
/**
********************************************************************************
*** PostListItemBean.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.asblogdata.bean;
import java.util.List;
import net.anotheria.util.sorter.IComparable;
import net.anotheria.util.BasicComparable;
/**
* Generated by class net.anotheria.asg.generator.view.action.ModuleBeanGenerator
*/
public class PostListItemBean implements IComparable{
// Generated by: class net.anotheria.asg.generator.view.action.ModuleBeanGenerator.generateListItemBean
private String id;
// Elements sort type is NUMERICAL
private int idForSorting;
private String name;
// Elements sort type is ALPHABETHICAL
private String nameForSorting;
private String created;
// Elements sort type is ALPHABETHICAL
private long createdForSorting;
private String updated;
// Elements sort type is ALPHABETHICAL
private long updatedForSorting;
private String blogger;
// Elements sort type is ALPHABETHICAL
private String bloggerForSorting;
private String tags;
// Elements sort type is CONTAINERS
private List tagsForSorting;
private String editLink;
private String deleteWithConfirmationLink;
private String lockLink;
private String unlockLink;
private String plainId;
private String documentLastUpdateTimestamp;
public void setIdForSorting(String idForSorting ){
this.idForSorting = Integer.parseInt(idForSorting);
}
public int getIdForSorting(){
return idForSorting;
}
public void setId(String id ){
this.id = id;
}
public String getId(){
return id;
}
public void setNameForSorting(String nameForSorting ){
this.nameForSorting = nameForSorting;
}
public String getNameForSorting(){
return nameForSorting;
}
public void setName(String name ){
this.name = name;
}
public String getName(){
return name;
}
public void setCreatedForSorting(long createdForSorting ){
this.createdForSorting = createdForSorting;
}
public long getCreatedForSorting(){
return createdForSorting;
}
public void setCreated(String created ){
this.created = created;
}
public String getCreated(){
return created;
}
public void setUpdatedForSorting(long updatedForSorting ){
this.updatedForSorting = updatedForSorting;
}
public long getUpdatedForSorting(){
return updatedForSorting;
}
public void setUpdated(String updated ){
this.updated = updated;
}
public String getUpdated(){
return updated;
}
public void setBloggerForSorting(String bloggerForSorting ){
this.bloggerForSorting = bloggerForSorting;
}
public String getBloggerForSorting(){
return bloggerForSorting;
}
public void setBlogger(String blogger ){
this.blogger = blogger;
}
public String getBlogger(){
return blogger;
}
public void setTagsForSorting(List tagsForSorting ){
this.tagsForSorting = tagsForSorting;
}
public List getTagsForSorting(){
return tagsForSorting;
}
public void setTags(String tags ){
this.tags = tags;
}
public String getTags(){
return tags;
}
public void setEditLink(String editLink ){
this.editLink = editLink;
}
public String getEditLink(){
return editLink;
}
public void setDeleteWithConfirmationLink(String deleteWithConfirmationLink ){
this.deleteWithConfirmationLink = deleteWithConfirmationLink;
}
public String getDeleteWithConfirmationLink(){
return deleteWithConfirmationLink;
}
public void setLockLink(String lockLink ){
this.lockLink = lockLink;
}
public String getLockLink(){
return lockLink;
}
public void setUnlockLink(String unlockLink ){
this.unlockLink = unlockLink;
}
public String getUnlockLink(){
return unlockLink;
}
public void setPlainId(String plainId ){
this.plainId = plainId;
}
public String getPlainId(){
return plainId;
}
public void setDocumentLastUpdateTimestamp(String documentLastUpdateTimestamp ){
this.documentLastUpdateTimestamp = documentLastUpdateTimestamp;
}
public String getDocumentLastUpdateTimestamp(){
return documentLastUpdateTimestamp;
}
/**
* LockableObject "locked" property. For object Locking.
*/
private boolean locked;
public void setLocked(boolean locked ){
this.locked = locked;
}
public boolean isLocked(){
return locked;
}
/**
* LockableObject "lockerId" property. For userName containing.
*/
private String lockerId;
public void setLockerId(String lockerId ){
this.lockerId = lockerId;
}
public String getLockerId(){
return lockerId;
}
/**
* LockableObject "lockingTime" property.
*/
private String lockingTime;
public void setLockingTime(String lockingTime ){
this.lockingTime = lockingTime;
}
public String getLockingTime(){
return lockingTime;
}
public int compareTo(IComparable anotherComparable, int method){
PostListItemBean anotherBean = (PostListItemBean) anotherComparable;
switch(method){
case PostListItemBeanSortType.SORT_BY_ID:
return BasicComparable.compareInt(idForSorting, anotherBean.idForSorting);
case PostListItemBeanSortType.SORT_BY_NAME:
return BasicComparable.compareString(nameForSorting, anotherBean.nameForSorting);
case PostListItemBeanSortType.SORT_BY_CREATED:
return BasicComparable.compareLong(createdForSorting, anotherBean.createdForSorting);
case PostListItemBeanSortType.SORT_BY_UPDATED:
return BasicComparable.compareLong(updatedForSorting, anotherBean.updatedForSorting);
case PostListItemBeanSortType.SORT_BY_BLOGGER:
return BasicComparable.compareString(bloggerForSorting, anotherBean.bloggerForSorting);
case PostListItemBeanSortType.SORT_BY_TAGS:
return BasicComparable.compareList(tagsForSorting, anotherBean.tagsForSorting);
default:
throw new RuntimeException("Sort method "+method+" is not supported.");
}
}
}