Patch from Dave to make requestCompleted() final and to add a retype() method.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2572 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2009-06-09 05:30:48 +00:00
parent 17d7492248
commit 31da661a18
@@ -27,9 +27,19 @@ package com.samskivert.util;
public abstract class FailureListener<T>
implements ResultListener<T>
{
// documentation inherited from interface ResultListener
public void requestCompleted (T result)
// from interface ResultListener
public final void requestCompleted (T result)
{
// Yeah, yeah, yeah. You did something. Good for you.
}
/**
* Recasts us to look like we're of a different type. We can safely do this because we know
* that requestCompleted never actually looks at the value passed in.
*/
public <V> FailureListener<V> retype (Class<V> klass)
{
@SuppressWarnings("unchecked") FailureListener<V> casted = (FailureListener<V>)this;
return casted;
}
}