cdx.scorebot.util.translator
Class TranslatorBooleanString

java.lang.Object
  extended by cdx.scorebot.util.translator.TypeTranslator<java.lang.Boolean,java.lang.String>
      extended by cdx.scorebot.util.translator.TranslatorBooleanString
All Implemented Interfaces:
java.io.Serializable

public class TranslatorBooleanString
extends TypeTranslator<java.lang.Boolean,java.lang.String>

Stores a value as a String and can translate to and from an Boolean.

Author:
David Underhill
See Also:
Serialized Form

Constructor Summary
TranslatorBooleanString()
          Instantiates a translator
 
Method Summary
 java.lang.String translate1(java.lang.Boolean valueToTranslate)
          gets the String representation of the specified Boolean
 java.lang.Boolean translate2(java.lang.String valueToTranslate)
          gets the Boolean representation of the specified String
 
Methods inherited from class cdx.scorebot.util.translator.TypeTranslator
canTranslate1, canTranslate2, getLastException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranslatorBooleanString

public TranslatorBooleanString()
Instantiates a translator

Method Detail

translate1

public java.lang.String translate1(java.lang.Boolean valueToTranslate)
gets the String representation of the specified Boolean

Specified by:
translate1 in class TypeTranslator<java.lang.Boolean,java.lang.String>
Parameters:
valueToTranslate - some Boolean
Returns:
the String representation of the valueToTranslate (null if valueToTranslate is null)

translate2

public java.lang.Boolean translate2(java.lang.String valueToTranslate)
                             throws TranslationFailedException
gets the Boolean representation of the specified String

Specified by:
translate2 in class TypeTranslator<java.lang.Boolean,java.lang.String>
Parameters:
valueToTranslate - some String
Returns:
the Boolean representation of the valueToTranslate
Throws:
TranslationFailedException - thrown if the value cannot be translated