JBoss Modular Service Kernel API 1.0.0.Beta4-SNAPSHOT

org.jboss.msc.translate
Class CastingTranslator<I,O>

java.lang.Object
  extended by org.jboss.msc.translate.CastingTranslator<I,O>
All Implemented Interfaces:
Translator<I,O>

public final class CastingTranslator<I,O>
extends Object
implements Translator<I,O>

A translator which casts (narrows) the type of its input.

Author:
David M. Lloyd

Constructor Summary
CastingTranslator(Class<O> type)
          Construct a new instance.
 
Method Summary
 O translate(I input)
          Translate an input value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CastingTranslator

public CastingTranslator(Class<O> type)
Construct a new instance.

Parameters:
type - the type to narrow to
Method Detail

translate

public O translate(I input)
            throws TranslationException
Translate an input value.

Specified by:
translate in interface Translator<I,O>
Parameters:
input - the input value
Returns:
the output value
Throws:
TranslationException - if the value could not be translated for some reason

JBoss Modular Service Kernel API 1.0.0.Beta4-SNAPSHOT

Copyright © 2010 JBoss, a division of Red Hat, Inc.