org.apache.oozie.util
Class ELConstantsFunctions

java.lang.Object
  extended by org.apache.oozie.util.ELConstantsFunctions

public class ELConstantsFunctions
extends Object

Base EL constants and functions.


Field Summary
static long GB
          GigaByte constant (1024 MB).
static long KB
          KiloByte constant (1024).
static long MB
          MegaByte constant (1024 KB).
static long PB
          PetaByte constant (1024 TB).
static int SUBMIT_DAYS
           
static int SUBMIT_HOURS
           
static int SUBMIT_MINUTES
           
static long TB
          TeraByte constant (1024 GB).
 
Constructor Summary
ELConstantsFunctions()
           
 
Method Summary
static String concat(String s1, String s2)
          Return the concatenation of 2 strings.
static Object firstNotNull(Object o1, Object o2)
          Return the first not null value, or null if both are null.
static String timestamp()
          Return the UTC current date and time in W3C format down to second (yyyy-MM-ddTHH:mm:ssZ).
static String toConfigurationStr(Map<String,String> map)
           
static String toJsonStr(Map<String,String> map)
           
static String toPropertiesStr(Map<String,String> map)
           
static String trim(String input)
          Return the trimmed version of the given string.
static String urlEncode(String input)
          Translates a string into application/x-www-form-urlencoded format using UTF-8 encoding scheme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KB

public static final long KB
KiloByte constant (1024). Defined for EL as 'KB'.

See Also:
Constant Field Values

MB

public static final long MB
MegaByte constant (1024 KB). Defined for EL as 'MB'.

See Also:
Constant Field Values

GB

public static final long GB
GigaByte constant (1024 MB). Defined for EL as 'GB'.

See Also:
Constant Field Values

TB

public static final long TB
TeraByte constant (1024 GB). Defined for EL as 'TB'.

See Also:
Constant Field Values

PB

public static final long PB
PetaByte constant (1024 TB). Defined for EL as 'PB'.

See Also:
Constant Field Values

SUBMIT_MINUTES

public static final int SUBMIT_MINUTES
See Also:
Constant Field Values

SUBMIT_HOURS

public static final int SUBMIT_HOURS
See Also:
Constant Field Values

SUBMIT_DAYS

public static final int SUBMIT_DAYS
See Also:
Constant Field Values
Constructor Detail

ELConstantsFunctions

public ELConstantsFunctions()
Method Detail

firstNotNull

public static Object firstNotNull(Object o1,
                                  Object o2)
Return the first not null value, or null if both are null. Defined for EL as 'Object firstNotNull(Object, Object)'.

Parameters:
o1 - first value.
o2 - second value.
Returns:
the first not null value, or or null if both are null

concat

public static String concat(String s1,
                            String s2)
Return the concatenation of 2 strings.

A string with null value is considered as an empty string.

Parameters:
s1 - first string.
s2 - second string.
Returns:
the concatenation of s1 and s2.

trim

public static String trim(String input)
Return the trimmed version of the given string.

Parameters:
input - string to be trimmed
Returns:
the trimmed version of the given string or the empty string if the given string was null

timestamp

public static String timestamp()
Return the UTC current date and time in W3C format down to second (yyyy-MM-ddTHH:mm:ssZ). i.e.: 1997-07-16T19:20:30Z

Returns:
the formatted time string.

urlEncode

public static String urlEncode(String input)
Translates a string into application/x-www-form-urlencoded format using UTF-8 encoding scheme. Bytes for unsafe characters are also obtained using UTF-8 scheme.

Parameters:
input - string to be encoded
Returns:
the encoded String

toJsonStr

public static String toJsonStr(Map<String,String> map)

toPropertiesStr

public static String toPropertiesStr(Map<String,String> map)

toConfigurationStr

public static String toConfigurationStr(Map<String,String> map)


Copyright © 2012 Apache Software Foundation. All Rights Reserved.