org.csc.phynixx.common.cast
Class ImplementorWrapper<Y extends IImplementor>

java.lang.Object
  extended by org.csc.phynixx.common.cast.ImplementorWrapper<Y>
Type Parameters:
Y -
All Implemented Interfaces:
IImplementor

public class ImplementorWrapper<Y extends IImplementor>
extends Object
implements IImplementor

Implementierung des von IImplementor fuer eine Delegatinon.

Author:
Christoph Schmidt-Casdorff

Constructor Summary
protected ImplementorWrapper(Y editable)
           
 
Method Summary
<X> X
cast(Class<X> iface)
          prueft, ob uebergebene Klasse assignable von aktueller Klasse ist.
protected  Y getWrapped()
           
<X> boolean
isImplementationOf(Class<X> cls)
          Prueft, ob cast in die gewuenschte Zielklasse moeglich ist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplementorWrapper

protected ImplementorWrapper(Y editable)
Method Detail

getWrapped

protected Y getWrapped()

cast

public <X> X cast(Class<X> iface)
prueft, ob uebergebene Klasse assignable von aktueller Klasse ist.

Specified by:
cast in interface IImplementor
Parameters:
iface - Zielklasse
Returns:
Objekt, welche das gewuenschte Klasse implementiert. Es wird kein Zusammenhang zwischen Ausgangsobjekt und Resultat vorausgesetzt (wie .z.B. sub/super, implements, instanceof etc)

isImplementationOf

public <X> boolean isImplementationOf(Class<X> cls)
Description copied from interface: IImplementor
Prueft, ob cast in die gewuenschte Zielklasse moeglich ist.

Ist cls==null, so wird false geliefert.

Specified by:
isImplementationOf in interface IImplementor
Type Parameters:
X - expected (Super)Type of the checked object
Parameters:
cls - target class / interface
Returns:
true if the current class can be safely casted to X


Copyright © 2015. All rights reserved.