org.jtheque.core.managers.properties
Interface IPropertiesManager

All Superinterfaces:
ActivableManager, IManager
All Known Implementing Classes:
PropertiesManager

public interface IPropertiesManager
extends ActivableManager

A properties manager specification.

Author:
Baptiste Wicht

Method Summary
 boolean areEquals(Object bean, Object other, String... properties)
          Test if two object are equals referring to a certain list of properties.
<T> T
createMemento(T bean)
          Create a memento for the bean.
 Object getProperty(Object bean, String property)
          Return the value of the property.
 Object getPropertyQuickly(Object bean, String property)
          Return the value of the property.
 void restoreMemento(Object bean, Object memento)
          Restore the state of the memento.
 String toString(Object bean)
          Generate a toString() String based on all the properties of the bean.
 
Methods inherited from interface org.jtheque.core.managers.ActivableManager
isEnabled, setEnabled
 
Methods inherited from interface org.jtheque.core.managers.IManager
close, init, preInit
 

Method Detail

createMemento

<T> T createMemento(T bean)
Create a memento for the bean. A memento is a clone of all the properties of the bean.

Note : The properties of the Object class are not retrieved.

Type Parameters:
T - The class of the bean.
Parameters:
bean - The bean to create the memento from.
Returns:
The memento.

toString

String toString(Object bean)
Generate a toString() String based on all the properties of the bean.

Note : The properties of the Object class are not retrieved.

Parameters:
bean - The bean.
Returns:
A String representation of all the properties of the bean.

restoreMemento

void restoreMemento(Object bean,
                    Object memento)
Restore the state of the memento. It seems to copy all the properties values from the memento to the bean.

Note : The properties of the Object class are not retrieved.

Parameters:
bean - The bean.
memento - The memento.

areEquals

boolean areEquals(Object bean,
                  Object other,
                  String... properties)
Test if two object are equals referring to a certain list of properties.

Parameters:
bean - The first bean.
other - The other bean.
properties - The properties to use.
Returns:
true if the two objects are equals else false.

getProperty

Object getProperty(Object bean,
                   String property)
Return the value of the property. This method parse the entire class, but use a cache, so it's better to use it when we have to access a lot of times the same class.

Parameters:
bean - The bean to get the property value from.
property - The property.
Returns:
the value of the property.

getPropertyQuickly

Object getPropertyQuickly(Object bean,
                          String property)
Return the value of the property. This method doesn't parse the entire class, so it's quicker than getProperty() but it doesn't use cache so if you've to use it many times, use getProperty().

Parameters:
bean - The bean to get the property value from.
property - The property.
Returns:
the value of the property.


Copyright © 2010 JTheque. All Rights Reserved.