You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/09/23 01:19:45 UTC
svn commit: r578525 -
/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java
Author: jdillon
Date: Sat Sep 22 16:19:41 2007
New Revision: 578525
URL: http://svn.apache.org/viewvc?rev=578525&view=rev
Log:
Drop marshal muck cause I want this puppy to be immutable, and I can't do that with externalizing muck
Modified:
geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java
Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java?rev=578525&r1=578524&r2=578525&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/util/Duration.java Sat Sep 22 16:19:41 2007
@@ -24,23 +24,20 @@
import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
-import org.apache.geronimo.gshell.remote.marshall.MarshalAware;
-import org.apache.geronimo.gshell.remote.marshall.Marshaller;
-import org.apache.mina.common.ByteBuffer;
/**
- * A representaion of a duration of time.
+ * A representaion of an immutable duration of time.
*
* @version $Rev$ $Date$
*/
public class Duration
- implements MarshalAware, Serializable
+ implements Serializable
{
public static final TimeUnit DEFAULT_UNIT = TimeUnit.MILLISECONDS;
- private long value;
+ public final long value;
- private TimeUnit unit;
+ public final TimeUnit unit;
public Duration(final long value, final TimeUnit unit) {
this.value = value;
@@ -88,23 +85,5 @@
result = 31 * result + (unit != null ? unit.hashCode() : 0);
return result;
- }
-
- public void writeExternal(final ByteBuffer out) throws Exception {
- assert out != null;
-
- out.putLong(value);
-
- Marshaller.writeEnum(out, unit);
- }
-
- public void readExternal(final ByteBuffer in) throws Exception {
- assert in != null;
-
- value = in.getLong();
-
- unit = Marshaller.readEnum(in, TimeUnit.class);
-
- assert unit != null;
}
}