Thread: [Asterisk-java-cvs] CVS: asterisk-java/src/java/net/sf/asterisk/manager/response ManagerError.java,1
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-03-13 11:27:46
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/response In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20829/src/java/net/sf/asterisk/manager/response Modified Files: ManagerError.java ManagerResponse.java Log Message: Removed dependcy on commons-lang Index: ManagerError.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/response/ManagerError.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ManagerError.java 23 Feb 2005 22:50:58 -0000 1.2 +++ ManagerError.java 13 Mar 2005 11:26:49 -0000 1.3 @@ -16,12 +16,9 @@ */ package net.sf.asterisk.manager.response; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; - /** - * Represents an "Response: Error" response received from the asterisk server. The cause for the - * error is given in the message attribute. + * Represents an "Response: Error" response received from the asterisk server. + * The cause for the error is given in the message attribute. * * @author srt * @version $Id$ @@ -34,20 +31,10 @@ public class ManagerError extends Manage static final long serialVersionUID = -8753149536715547476L; /** - * + * Creates a new ManagerError. */ public ManagerError() { } - - public boolean equals(Object o) - { - return EqualsBuilder.reflectionEquals(this, o); - } - - public int hashCode() - { - return HashCodeBuilder.reflectionHashCode(this); - } } Index: ManagerResponse.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/response/ManagerResponse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ManagerResponse.java 23 Feb 2005 22:50:58 -0000 1.2 +++ ManagerResponse.java 13 Mar 2005 11:26:49 -0000 1.3 @@ -19,15 +19,12 @@ package net.sf.asterisk.manager.response import java.io.Serializable; import java.util.Date; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.commons.lang.builder.ToStringBuilder; - /** - * Represents a response received from the Asterisk server as the result of a previously sent - * ManagerAction.<br> - * The response can be linked with the action that caused it by looking the action id attribute that - * will match the action id of the corresponding action. + * Represents a response received from the Asterisk server as the result of a + * previously sent ManagerAction.<br> + * The response can be linked with the action that caused it by looking the + * action id attribute that will match the action id of the corresponding + * action. * * @see net.sf.asterisk.manager.action.ManagerAction * @author srt @@ -47,7 +44,8 @@ public class ManagerResponse implements private String uniqueId; /** - * Returns the point in time this response was received from the asterisk server. + * Returns the point in time this response was received from the asterisk + * server. */ public Date getDateReceived() { @@ -55,7 +53,8 @@ public class ManagerResponse implements } /** - * Sets the point in time this response was received from the asterisk server. + * Sets the point in time this response was received from the asterisk + * server. */ public void setDateReceived(Date dateReceived) { @@ -63,8 +62,8 @@ public class ManagerResponse implements } /** - * Returns the action id received with this response referencing the action that generated this - * response. + * Returns the action id received with this response referencing the action + * that generated this response. */ public String getActionId() { @@ -80,8 +79,8 @@ public class ManagerResponse implements } /** - * Returns the message received with this response. The content depends on the action that - * generated this response. + * Returns the message received with this response. The content depends on + * the action that generated this response. */ public String getMessage() { @@ -97,8 +96,9 @@ public class ManagerResponse implements } /** - * Returns the value of the "Response:" line. This typically a String like "Success" or "Error" - * but depends on the action that generated this response. + * Returns the value of the "Response:" line. This typically a String like + * "Success" or "Error" but depends on the action that generated this + * response. */ public String getResponse() { @@ -114,8 +114,9 @@ public class ManagerResponse implements } /** - * Returns the unique id received with this response. The unique id is used to keep track of - * channels created by the action sent, for example an OriginateAction. + * Returns the unique id received with this response. The unique id is used + * to keep track of channels created by the action sent, for example an + * OriginateAction. */ public String getUniqueId() { @@ -130,18 +131,17 @@ public class ManagerResponse implements this.uniqueId = uniqueId; } - final public String toString() + public String toString() { - return ToStringBuilder.reflectionToString(this); - } + StringBuffer sb; - public boolean equals(Object o) - { - return EqualsBuilder.reflectionEquals(this, o); - } + sb = new StringBuffer(getClass().getName() + ": "); + sb.append("actionId='" + getActionId() + "'; "); + sb.append("message='" + getMessage() + "'; "); + sb.append("response='" + getResponse() + "'; "); + sb.append("uniqueId='" + getUniqueId() + "'; "); + sb.append("systemHashcode=" + System.identityHashCode(this)); - public int hashCode() - { - return HashCodeBuilder.reflectionHashCode(this); + return sb.toString(); } } |