org.syphr.prom
Interface Translator<T extends Enum<T>>

Type Parameters:
T - the type of Enums used to defined the properties

public interface Translator<T extends Enum<T>>

This interface defines the functionality required to translate back and forth between key constants (Enums) and property names.

It is required that any implementation be thread safe.

Author:
Gregory P. Moyer

Method Summary
 T getPropertyKey(String propertyName)
          This method translates the string property name into an Enum key that is used to reference the property via the properties management API.
 String getPropertyName(T propertyKey)
          This method translates the Enum key into a string property name that is used in the properties file.
 

Method Detail

getPropertyName

String getPropertyName(T propertyKey)
This method translates the Enum key into a string property name that is used in the properties file. There is not likely to be a need for client code to call this method directly. The PropertiesManager API will take care of reading and writing the actual file.

Parameters:
propertyKey - the Enum key to be translated into a property name
Returns:
the name that represents this property in the properties file

getPropertyKey

T getPropertyKey(String propertyName)
This method translates the string property name into an Enum key that is used to reference the property via the properties management API. There is not likely to be a need for client code to call this method directly. The PropertiesManager API will take care of reading and writing the actual file.

Parameters:
propertyName - the property name to be translated into an Enum key constant
Returns:
the associated Enum key constant


Copyright © 2010 Gregory P. Moyer. All Rights Reserved.