pt.digitalis.dif.utils
Class ObjectFormatter

java.lang.Object
  extended by pt.digitalis.dif.utils.ObjectFormatter

public class ObjectFormatter
extends Object

Helps to format an object for printing in human readable form

Author:
Pedro Viegas pviegas@digitalis.pt
Created on:
Dec 7, 2007

Constructor Summary
ObjectFormatter()
           
 
Method Summary
 ObjectFormatter addItem(String key, Object value)
          Adds an item to the buffer
 ObjectFormatter addItemIfNotNull(String key, Object value)
          Adds an item to the buffer if the value is not null
 String getFormatedObject()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFormatter

public ObjectFormatter()
Method Detail

addItem

public ObjectFormatter addItem(String key,
                               Object value)
Adds an item to the buffer

Parameters:
key - the key that identifies the value
value - the value
Returns:
the updated instance (fluent interface)

addItemIfNotNull

public ObjectFormatter addItemIfNotNull(String key,
                                        Object value)
Adds an item to the buffer if the value is not null

Parameters:
key - the key that identifies the value
value - the value
Returns:
the updated instance (fluent interface)

getFormatedObject

public String getFormatedObject()
Returns:
the formatted object


Copyright © 2014 Digitalis Informática Lda. All Rights Reserved.