org.specrunner.converters.core
Class ConverterNotNullNotEmpty

java.lang.Object
  extended by org.specrunner.converters.core.ConverterNotNullNotEmpty
All Implemented Interfaces:
Serializable, IConverter, IResetable
Direct Known Subclasses:
AbstractConverterTimezone, ConverterBigDecimal, ConverterBooleanTemplate, ConverterByte, ConverterCharacter, ConverterDateTimePatternArgs, ConverterDateTimePatternTemplate, ConverterDouble, ConverterEnum, ConverterEnumValue, ConverterFloat, ConverterInteger, ConverterLocalDatePatternTemplate, ConverterLong, ConverterNumber, ConverterObject, ConverterShort

public class ConverterNotNullNotEmpty
extends Object
implements IConverter

Basic nullable converter. Accept only not null values and not empty strings.

Author:
Thiago Santos.
See Also:
Serialized Form

Constructor Summary
ConverterNotNullNotEmpty()
           
 
Method Summary
 boolean accept(Object obj)
          Indicate if the converter accepts a given input value.
 Object convert(Object obj, Object[] args)
          Convert a given object to another using some arguments as auxiliary.
 void initialize()
          Initialize something.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterNotNullNotEmpty

public ConverterNotNullNotEmpty()
Method Detail

initialize

public void initialize()
Description copied from interface: IResetable
Initialize something.

Specified by:
initialize in interface IResetable

accept

public boolean accept(Object obj)
Description copied from interface: IConverter
Indicate if the converter accepts a given input value.

Specified by:
accept in interface IConverter
Parameters:
obj - The value.
Returns:
true, if accepted, false, otherwise.

convert

public Object convert(Object obj,
                      Object[] args)
               throws ConverterException
Description copied from interface: IConverter
Convert a given object to another using some arguments as auxiliary.

Specified by:
convert in interface IConverter
Parameters:
obj - The value to be converted.
args - The arguments.
Returns:
The converted object.
Throws:
ConverterException - On conversion errors.


Copyright © 2014. All rights reserved.