1 2 24 25 package com.sun.enterprise.connectors.authentication; 26 27 import java.io.Serializable ; 28 29 36 37 public class EisBackendPrincipal implements Serializable { 38 39 40 private String userName; 41 private String password; 42 43 45 46 public EisBackendPrincipal() { 47 48 } 49 50 56 57 public EisBackendPrincipal(String userName, String password) { 58 this.userName = userName; 59 this.password = password; 60 } 61 62 66 67 public void setUserName(String userName) { 68 this.userName = userName; 69 } 70 71 75 76 public void setPassword(String password) { 77 this.password = password; 78 } 79 80 84 85 public String getUserName() { 86 return userName; 87 } 88 89 93 94 public String getPassword() { 95 return password; 96 } 97 98 106 107 public boolean equals(Object backendPrincipal) { 108 109 if(backendPrincipal == null || 110 !(backendPrincipal instanceof EisBackendPrincipal)) { 111 return false; 112 } 113 EisBackendPrincipal eisBackendPrincipal = 114 (EisBackendPrincipal)backendPrincipal; 115 116 if(isEqual(eisBackendPrincipal.userName,this.userName) && 117 isEqual(eisBackendPrincipal.password,this.password)) { 118 return true; 119 } else { 120 return false; 121 122 } 123 } 124 125 128 129 private boolean isEqual(String in, String out) { 130 if(in == null && out == null) { 131 return true; 132 } 133 if(in == null || out == null) { 134 return false; 135 } 136 return (out.equals(in)); 137 } 138 } 139 | Popular Tags |