com.perforce.p4java.util
Class PropertiesHelper

java.lang.Object
  extended by com.perforce.p4java.util.PropertiesHelper

public class PropertiesHelper
extends Object

Properties helper class with generally useful methods.


Constructor Summary
PropertiesHelper()
           
 
Method Summary
static String getProperty(Properties props, String[] keys)
          Return the first property string value found from the passed-in properties with the specified keys.
static String getProperty(Properties props, String[] keys, String defaultValue)
          Return the first property string value found from the passed-in properties with the specified keys.
static int getPropertyAsInt(Properties props, String[] keys, int defaultValue)
          Return the first property value found as an int, if possible.
static long getPropertyAsLong(Properties props, String[] keys, long defaultValue)
          Return the property value as a long, if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesHelper

public PropertiesHelper()
Method Detail

getProperty

public static String getProperty(Properties props,
                                 String[] keys)
Return the first property string value found from the passed-in properties with the specified keys.


getProperty

public static String getProperty(Properties props,
                                 String[] keys,
                                 String defaultValue)
Return the first property string value found from the passed-in properties with the specified keys. If it can't find a value, then return the passed-in defaultValue.


getPropertyAsInt

public static int getPropertyAsInt(Properties props,
                                   String[] keys,
                                   int defaultValue)
Return the first property value found as an int, if possible. If it can't find a value, then return the passed-in defaultValue.


getPropertyAsLong

public static long getPropertyAsLong(Properties props,
                                     String[] keys,
                                     long defaultValue)
Return the property value as a long, if possible. If it can't find a value by the specified key, then return the passed-in defaultValue.



Copyright © 2015 Perforce Software. All Rights Reserved.