/data/jpa/src/test/java/org/appfuse/dao/jpa/mock/MockRoleBadGetter.java
Java | 84 lines | 58 code | 20 blank | 6 comment | 6 complexity | 4b0ae7fc4f03c1833858c649b1990bf3 MD5 | raw file
- package org.appfuse.dao.jpa.mock;
- import org.apache.commons.lang.builder.ToStringBuilder;
- import org.apache.commons.lang.builder.ToStringStyle;
- import javax.persistence.Column;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import javax.persistence.Id;
- import javax.persistence.Transient;
- /**
- * @author <a href="mailto:bwnoll@gmail.com">Bryan Noll</a>
- */
- public class MockRoleBadGetter {
- private static final long serialVersionUID = 3690197650654049848L;
-
- @Id @GeneratedValue(strategy=GenerationType.AUTO)
- private Long id;
- private String name;
- private String description;
- public MockRoleBadGetter() {
- }
- public MockRoleBadGetter(String name) {
- this.name = name;
- }
- public Long getPersistentId() {
- return id;
- }
- /**
- * @see org.springframework.security.core.GrantedAuthority#getAuthority()
- */
- @Transient
- public String getAuthority() {
- return getName();
- }
- @Column(length=20)
- public String getName() {
- return this.name;
- }
- @Column(length=64)
- public String getDescription() {
- return this.description;
- }
- public void setPersistentId(Long id) {
- this.id = id;
- }
- public void setName(String name) {
- this.name = name;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof MockRoleBadGetter)) return false;
- final MockRoleBadGetter role = (MockRoleBadGetter) o;
- return !(name != null ? !name.equals(role.name) : role.name != null);
- }
- public int hashCode() {
- return (name != null ? name.hashCode() : 0);
- }
- public String toString() {
- return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
- .append(this.name)
- .toString();
- }
- }