public int compareTo(Object obj, boolean caseInsensitive) { if (obj == null) { return -1; } if (caseInsensitive) ; // this is to avoid eclipse warning only. if (!(Session_Exc_TimesVo.class.isAssignableFrom(obj.getClass()))) { throw new ClassCastException( "A Session_Exc_TimesVo object cannot be compared an Object of type " + obj.getClass().getName()); } Session_Exc_TimesVo compareObj = (Session_Exc_TimesVo) obj; int retVal = 0; if (retVal == 0) { if (this.getStartTime() == null && compareObj.getStartTime() != null) return -1; if (this.getStartTime() != null && compareObj.getStartTime() == null) return 1; if (this.getStartTime() != null && compareObj.getStartTime() != null) retVal = this.getStartTime().compareTo(compareObj.getStartTime()); } if (retVal == 0) { if (this.getEndTime() == null && compareObj.getEndTime() != null) return -1; if (this.getEndTime() != null && compareObj.getEndTime() == null) return 1; if (this.getEndTime() != null && compareObj.getEndTime() != null) retVal = this.getEndTime().compareTo(compareObj.getEndTime()); } return retVal; }