Links.java
资源名称:Myblog.rar [点击查看]
上传用户:wlfwy2004
上传日期:2016-12-12
资源大小:33978k
文件大小:2k
源码类别:
Jsp/Servlet
开发平台:
Java
- package com.opensource.blog.model;
- import java.io.Serializable;
- import org.apache.commons.lang.builder.EqualsBuilder;
- import org.apache.commons.lang.builder.HashCodeBuilder;
- import org.apache.commons.lang.builder.ToStringBuilder;
- public class Links
- implements Serializable {
- /** identifier field */
- private Long id;
- /** persistent field */
- private long blogid;
- /** persistent field */
- private int linktype;
- /** persistent field */
- private String linkurl;
- /** nullable persistent field */
- private String linktext;
- /** nullable persistent field */
- private String linkimgsrc;
- /** full constructor */
- public Links(long blogid, int linktype, String linkurl, String linktext,
- String linkimgsrc) {
- this.blogid = blogid;
- this.linktype = linktype;
- this.linkurl = linkurl;
- this.linktext = linktext;
- this.linkimgsrc = linkimgsrc;
- }
- /** default constructor */
- public Links() {
- }
- /** minimal constructor */
- public Links(long blogid, int linktype, String linkurl) {
- this.blogid = blogid;
- this.linktype = linktype;
- this.linkurl = linkurl;
- }
- public Long getId() {
- return this.id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public long getBlogid() {
- return this.blogid;
- }
- public void setBlogid(long blogid) {
- this.blogid = blogid;
- }
- public int getLinktype() {
- return this.linktype;
- }
- public void setLinktype(int linktype) {
- this.linktype = linktype;
- }
- public String getLinkurl() {
- return this.linkurl;
- }
- public void setLinkurl(String linkurl) {
- this.linkurl = linkurl;
- }
- public String getLinktext() {
- return this.linktext;
- }
- public void setLinktext(String linktext) {
- this.linktext = linktext;
- }
- public String getLinkimgsrc() {
- return this.linkimgsrc;
- }
- public void setLinkimgsrc(String linkimgsrc) {
- this.linkimgsrc = linkimgsrc;
- }
- public String toString() {
- return new ToStringBuilder(this)
- .append("id", getId())
- .toString();
- }
- public boolean equals(Object other) {
- if (! (other instanceof Links)) {
- return false;
- }
- Links castOther = (Links) other;
- return new EqualsBuilder()
- .append(this.getId(), castOther.getId())
- .isEquals();
- }
- public int hashCode() {
- return new HashCodeBuilder()
- .append(getId())
- .toHashCode();
- }
- }