org.apache.hadoop.mapreduce.util
Class ResourceBundles

java.lang.Object
  extended by org.apache.hadoop.mapreduce.util.ResourceBundles

public class ResourceBundles
extends Object

Helper class to handle resource bundles in a saner way


Constructor Summary
ResourceBundles()
           
 
Method Summary
static ResourceBundle getBundle(String bundleName)
          Get a resource bundle
static String getCounterGroupName(String group, String defaultValue)
          Get the counter group display name
static String getCounterName(String group, String counter, String defaultValue)
          Get the counter display name
static
<T> T
getValue(String bundleName, String key, String suffix, T defaultValue)
          Get a resource given bundle name and key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceBundles

public ResourceBundles()
Method Detail

getBundle

public static ResourceBundle getBundle(String bundleName)
Get a resource bundle

Parameters:
bundleName - of the resource
Returns:
the resource bundle
Throws:
MissingResourceException

getValue

public static <T> T getValue(String bundleName,
                             String key,
                             String suffix,
                             T defaultValue)
Get a resource given bundle name and key

Type Parameters:
T - type of the resource
Parameters:
bundleName - name of the resource bundle
key - to lookup the resource
suffix - for the key to lookup
defaultValue - of the resource
Returns:
the resource or the defaultValue
Throws:
ClassCastException - if the resource found doesn't match T

getCounterGroupName

public static String getCounterGroupName(String group,
                                         String defaultValue)
Get the counter group display name

Parameters:
group - the group name to lookup
defaultValue - of the group
Returns:
the group display name

getCounterName

public static String getCounterName(String group,
                                    String counter,
                                    String defaultValue)
Get the counter display name

Parameters:
group - the counter group name for the counter
counter - the counter name to lookup
defaultValue - of the counter
Returns:
the counter display name


Copyright © 2013 Apache Software Foundation. All Rights Reserved.