📄 bookvalue.java
字号:
/* * Generated by XDoclet - Do not edit! */package de.laliluna.tutorial.library.entity.interfaces;/** * Value object for Book. * * Notice, this object is used to represent the state of an * Book object. This value object * Is not connected to the database in any way, it is just a normal object used * as a container for data from an EJB. * * @xdoclet-generated at ${TODAY} * @copyright The XDoclet Team * @author XDoclet * @version ${version} */public class BookValue extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable { private java.lang.Integer id; private boolean idHasBeenSet = false; private java.lang.String title; private boolean titleHasBeenSet = false; private java.lang.String author; private boolean authorHasBeenSet = false; private java.lang.Boolean available; private boolean availableHasBeenSet = false; private java.lang.Integer userId; private boolean userIdHasBeenSet = false; private java.lang.Integer primaryKey; public BookValue() { } public BookValue( java.lang.Integer id,java.lang.String title,java.lang.String author,java.lang.Boolean available,java.lang.Integer userId ) { setId(id); setTitle(title); setAuthor(author); setAvailable(available); setUserId(userId); primaryKey = this.getId(); } /** * @deprecated use {@link #clone} */ public BookValue( BookValue otherValue ) { this.id = otherValue.id; idHasBeenSet = true; this.title = otherValue.title; titleHasBeenSet = true; this.author = otherValue.author; authorHasBeenSet = true; this.available = otherValue.available; availableHasBeenSet = true; this.userId = otherValue.userId; userIdHasBeenSet = true; primaryKey = this.getId(); } public java.lang.Integer getPrimaryKey() { return primaryKey; } public void setPrimaryKey( java.lang.Integer primaryKey) { // it's also nice to update PK object - just in case // somebody would ask for it later... this.primaryKey = primaryKey; setId( primaryKey ); } public java.lang.Integer getId() { return this.id; } public void setId( java.lang.Integer id ) { this.id = id; idHasBeenSet = true; primaryKey = id; } public boolean idHasBeenSet(){ return idHasBeenSet; } public java.lang.String getTitle() { return this.title; } public void setTitle( java.lang.String title ) { this.title = title; titleHasBeenSet = true; } public boolean titleHasBeenSet(){ return titleHasBeenSet; } public java.lang.String getAuthor() { return this.author; } public void setAuthor( java.lang.String author ) { this.author = author; authorHasBeenSet = true; } public boolean authorHasBeenSet(){ return authorHasBeenSet; } public java.lang.Boolean getAvailable() { return this.available; } public void setAvailable( java.lang.Boolean available ) { this.available = available; availableHasBeenSet = true; } public boolean availableHasBeenSet(){ return availableHasBeenSet; } public java.lang.Integer getUserId() { return this.userId; } public void setUserId( java.lang.Integer userId ) { this.userId = userId; userIdHasBeenSet = true; } public boolean userIdHasBeenSet(){ return userIdHasBeenSet; } public String toString() { StringBuffer str = new StringBuffer("{"); str.append("id=" + getId() + " " + "title=" + getTitle() + " " + "author=" + getAuthor() + " " + "available=" + getAvailable() + " " + "userId=" + getUserId()); str.append('}'); return(str.toString()); } /** * A Value Object has an identity if the attributes making its Primary Key have all been set. An object without identity is never equal to any other object. * * @return true if this instance has an identity. */ protected boolean hasIdentity() { return idHasBeenSet; } /** * * @deprecated use {@link #equals} */ public boolean isIdentical(Object other) { if (other instanceof BookValue) { BookValue that = (BookValue) other; boolean lEquals = true; if( this.title == null ) { lEquals = lEquals && ( that.title == null ); } else { lEquals = lEquals && this.title.equals( that.title ); } if( this.author == null ) { lEquals = lEquals && ( that.author == null ); } else { lEquals = lEquals && this.author.equals( that.author ); } if( this.available == null ) { lEquals = lEquals && ( that.available == null ); } else { lEquals = lEquals && this.available.equals( that.available ); } if( this.userId == null ) { lEquals = lEquals && ( that.userId == null ); } else { lEquals = lEquals && this.userId.equals( that.userId ); } return lEquals; } else { return false; } } public boolean equals(Object other) { //If it's not the correct type, clearly it isn't equal to this. if (!(other instanceof BookValue)) { return false; } return equals((BookValue) other); } /** * This class is not using strict ordering. This means that the object is not Comparable, and * each check for equality will test all members for equality. We do not check collections for * equality however, so you would be wise to not use this if you have collection typed EJB References. */ public boolean equals(BookValue that) { //try to get lucky. if (this == that) { return true; } //this clearly isn't null. if(null == that) { return false; } if(this.id != that.id) { if( this.id == null || that.id == null ) { return false; } if(!this.id.equals(that.id)) { return false; } } if(this.title != that.title) { if( this.title == null || that.title == null ) { return false; } if(!this.title.equals(that.title)) { return false; } } if(this.author != that.author) { if( this.author == null || that.author == null ) { return false; } if(!this.author.equals(that.author)) { return false; } } if(this.available != that.available) { if( this.available == null || that.available == null ) { return false; } if(!this.available.equals(that.available)) { return false; } } if(this.userId != that.userId) { if( this.userId == null || that.userId == null ) { return false; } if(!this.userId.equals(that.userId)) { return false; } } return true; } public Object clone() throws java.lang.CloneNotSupportedException { BookValue other = (BookValue) super.clone(); return other; } public ReadOnlyBookValue getReadOnlyBookValue() { return new ReadOnlyBookValue(); } public int hashCode(){ int result = 17; result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); result = 37*result + ((this.title != null) ? this.title.hashCode() : 0); result = 37*result + ((this.author != null) ? this.author.hashCode() : 0); result = 37*result + ((this.available != null) ? this.available.hashCode() : 0); result = 37*result + ((this.userId != null) ? this.userId.hashCode() : 0); return result; } /** * Covariant function so the compiler can choose the proper one at compile time, * eliminates the need for XDoclet to really understand compiletime typing. * * Read only collections need to be synchronized. Once we start giving out handles * to these collections, they'll be used in other threads sooner or later. */ private static java.util.Collection wrapCollection(java.util.Collection input) { return java.util.Collections.synchronizedCollection(input); } /** * Covariant function so the compiler can choose the proper one at compile time, * eliminates the need for XDoclet to really understand compiletime typing. * * Read only collections need to be synchronized. Once we start giving out handles * to these collections, they'll be used in other threads sooner or later. */ private static java.util.Set wrapCollection(java.util.Set input) { return java.util.Collections.synchronizedSet(input); } /** * Covariant function. This is used in covariant form so that the compiler * can do some of our conditional branches for us. If I made these functions * have different names, then XDoclet would have to choose between them based on * compiletime types, that wouldn't be easy. */ private static java.util.Collection wrapReadOnly(java.util.Collection input) { return java.util.Collections.unmodifiableCollection(input); } /** * Covariant function. This is used in covariant form so that the compiler * can do some of our conditional branches for us. If I made these functions * have different names, then XDoclet would have to choose between them based on * compiletime types, that wouldn't be easy. */ private static java.util.Set wrapReadOnly(java.util.Set input) { return java.util.Collections.unmodifiableSet(input); } private final class ReadOnlyBookValue implements java.lang.Cloneable, java.io.Serializable { private BookValue underlying() { return BookValue.this; } public java.lang.Integer getId() { return underlying().id; } public java.lang.String getTitle() { return underlying().title; } public java.lang.String getAuthor() { return underlying().author; } public java.lang.Boolean getAvailable() { return underlying().available; } public java.lang.Integer getUserId() { return underlying().userId; } public int hashCode() { return 101 * underlying().hashCode(); } public boolean equals(Object o) { if(o instanceof ReadOnlyBookValue) { return this.equals((ReadOnlyBookValue) o); } return false; } public boolean equals(ReadOnlyBookValue that) { if(null == that) { return false; } return this.underlying().equals(that.underlying()); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -