📄 uservalue.java
字号:
/* * Generated by XDoclet - Do not edit! */package de.laliluna.tutorial.library.entity.interfaces;/** * Value object for User. * * @xdoclet-generated at ${TODAY} * @copyright The XDoclet Team * @author XDoclet * @version ${version} */public class UserValue extends java.lang.Object implements java.io.Serializable { private java.lang.Integer id; private boolean idHasBeenSet = false; private java.lang.String name; private boolean nameHasBeenSet = false; private java.lang.String lastName; private boolean lastNameHasBeenSet = false; private java.lang.Integer age; private boolean ageHasBeenSet = false; private java.lang.Integer pk; public UserValue() { } public UserValue( java.lang.Integer id,java.lang.String name,java.lang.String lastName,java.lang.Integer age ) { this.id = id; idHasBeenSet = true; this.name = name; nameHasBeenSet = true; this.lastName = lastName; lastNameHasBeenSet = true; this.age = age; ageHasBeenSet = true; pk = this.getId(); } //TODO Cloneable is better than this ! public UserValue( UserValue otherValue ) { this.id = otherValue.id; idHasBeenSet = true; this.name = otherValue.name; nameHasBeenSet = true; this.lastName = otherValue.lastName; lastNameHasBeenSet = true; this.age = otherValue.age; ageHasBeenSet = true; pk = this.getId(); } public java.lang.Integer getPrimaryKey() { return pk; } public void setPrimaryKey( java.lang.Integer pk ) { // it's also nice to update PK object - just in case // somebody would ask for it later... this.pk = pk; setId( pk ); } public java.lang.Integer getId() { return this.id; } public void setId( java.lang.Integer id ) { this.id = id; idHasBeenSet = true; pk = id; } public boolean idHasBeenSet(){ return idHasBeenSet; } public java.lang.String getName() { return this.name; } public void setName( java.lang.String name ) { this.name = name; nameHasBeenSet = true; } public boolean nameHasBeenSet(){ return nameHasBeenSet; } public java.lang.String getLastName() { return this.lastName; } public void setLastName( java.lang.String lastName ) { this.lastName = lastName; lastNameHasBeenSet = true; } public boolean lastNameHasBeenSet(){ return lastNameHasBeenSet; } public java.lang.Integer getAge() { return this.age; } public void setAge( java.lang.Integer age ) { this.age = age; ageHasBeenSet = true; } public boolean ageHasBeenSet(){ return ageHasBeenSet; } public String toString() { StringBuffer str = new StringBuffer("{"); str.append("id=" + getId() + " " + "name=" + getName() + " " + "lastName=" + getLastName() + " " + "age=" + getAge()); 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; } public boolean equals(Object other) { if (this == other) return true; if ( ! hasIdentity() ) return false; if (other instanceof UserValue) { UserValue that = (UserValue) other; if ( ! that.hasIdentity() ) return false; boolean lEquals = true; if( this.id == null ) { lEquals = lEquals && ( that.id == null ); } else { lEquals = lEquals && this.id.equals( that.id ); } lEquals = lEquals && isIdentical(that); return lEquals; } else { return false; } } public boolean isIdentical(Object other) { if (other instanceof UserValue) { UserValue that = (UserValue) other; boolean lEquals = true; if( this.name == null ) { lEquals = lEquals && ( that.name == null ); } else { lEquals = lEquals && this.name.equals( that.name ); } if( this.lastName == null ) { lEquals = lEquals && ( that.lastName == null ); } else { lEquals = lEquals && this.lastName.equals( that.lastName ); } if( this.age == null ) { lEquals = lEquals && ( that.age == null ); } else { lEquals = lEquals && this.age.equals( that.age ); } return lEquals; } else { return false; } } public int hashCode(){ int result = 17; result = 37*result + ((this.id != null) ? this.id.hashCode() : 0); result = 37*result + ((this.name != null) ? this.name.hashCode() : 0); result = 37*result + ((this.lastName != null) ? this.lastName.hashCode() : 0); result = 37*result + ((this.age != null) ? this.age.hashCode() : 0); return result; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -