Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Interface Mappable

All Known Implementing Classes:
User

public interface Mappable

Objects that implement this interface are claiming that there is a one-to-one relation between one field value and a key field value. A classic example of this in Expresso is the fact that a ExpUid maps one to one to the LoginName. This helps guarantee that lookup objects can map to a specific value.

Since:
Expresso 5.1
Author:
Michael Rimov

Method Summary
 String getKeyValue(String mappedValue)
          Given a 'friendly name' get the key value for this object.
 String getMappedDescription()
          It returns if the field description for the mapped value as specified by the key value parameter.
 String getMappedValue(String keyValue)
          Given a key value, return the mapped value.
 

Method Detail

getKeyValue

public String getKeyValue(String mappedValue)
Given a 'friendly name' get the key value for this object. Example, mappedValue = "Admin", then getKeyValue("Admin") will return "3"

Parameters:
mappedValue - the value to convert to a key field. It will return null if the mapped value does not exist.
Returns:
java.lang.String or null.

getMappedValue

public String getMappedValue(String keyValue)
Given a key value, return the mapped value. So for example: getMappedValue("3") will return "Admin"

Parameters:
keyValue - the key value to map
Returns:
the mapped value. It will return null if the key does not exist

getMappedDescription

public String getMappedDescription()
It returns if the field description for the mapped value as specified by the key value parameter.

Returns:
String the mapped description

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.