public class UtilFormatOut extends Object
| Constructor and Description |
|---|
UtilFormatOut() |
| Modifier and Type | Method and Description |
|---|---|
static String |
checkEmpty(String string1,
String string2)
Returns the first passed String if not empty, otherwise the second if not empty, otherwise an empty but non-null String.
|
static String |
checkEmpty(String string1,
String string2,
String string3)
Returns the first passed String if not empty, otherwise the second if not empty, otherwise the third if not empty, otherwise an empty but non-null String.
|
static String |
checkNull(String string1)
Checks to see if the passed string is null, if it is returns an empty but non-null string.
|
static String |
checkNull(String string1,
String string2)
Returns the first passed String if not null, otherwise the second if not null, otherwise an empty but non-null String.
|
static String |
checkNull(String string1,
String string2,
String string3)
Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise an empty but non-null String.
|
static String |
checkNull(String string1,
String string2,
String string3,
String string4)
Returns the first passed String if not null, otherwise the second if not null, otherwise the third if not null, otherwise the fourth if not null, otherwise an empty but non-null String.
|
static String |
decodeQueryValue(String query)
Decodes a single query value from an HTTP URL parameter, replacing %ASCII values with characters
|
static String |
encodeQuery(String query)
Encodes an HTTP URL query String, replacing characters used for other things in HTTP URL query strings, but not touching the separator characters '?', '=', and '&'
|
static String |
encodeQueryValue(String query)
Encodes a single HTTP URL query value, replacing characters used for other things in HTTP URL query strings
|
static String |
encodeXmlValue(String inString)
Encodes an XML string replacing the characters '<', '>', '"', ''', '&'
|
static String |
formatDate(Timestamp timestamp)
Formats a String timestamp into a nice string
|
static String |
formatPercentage(double percentage)
Formats a double representing a percentage into a string
|
static String |
formatPercentage(Double percentage)
Formats a Double representing a percentage into a string
|
static String |
formatPrice(double price)
Formats a double representing a price into a string
|
static String |
formatPrice(Double price)
Formats a Double representing a price into a string
|
static String |
formatQuantity(double quantity)
Formats an double representing a quantity into a string
|
static String |
formatQuantity(Double quantity)
Formats an Double representing a quantity into a string
|
static String |
formatQuantity(float quantity)
Formats a float representing a quantity into a string
|
static String |
formatQuantity(Float quantity)
Formats a Float representing a quantity into a string
|
static String |
formatQuantity(int quantity)
Formats an int representing a quantity into a string
|
static String |
formatQuantity(Integer quantity)
Formats an Integer representing a quantity into a string
|
static String |
formatQuantity(long quantity)
Formats an int representing a quantity into a string
|
static String |
formatQuantity(Long quantity)
Formats an Long representing a quantity into a string
|
static String |
ifNotEmpty(String base,
String pre,
String post)
Returns
pre + base + post if base String is not null or empty, otherwise an empty but non-null String. |
static String |
makeString(Object obj1)
Checks to see if the passed Object is null, if it is returns an empty but non-null string, otherwise calls toString() on the object
|
static String |
replaceString(String mainString,
String oldString,
String newString)
Replaces all occurances of oldString in mainString with newString
|
public static String formatPrice(Double price)
price - The price Double to be formattedpublic static String formatPrice(double price)
price - The price double to be formattedpublic static String formatPercentage(Double percentage)
percentage - The percentage Double to be formattedpublic static String formatPercentage(double percentage)
percentage - The percentage double to be formattedpublic static String formatQuantity(Long quantity)
quantity - The quantity Long to be formattedpublic static String formatQuantity(long quantity)
quantity - The quantity long to be formattedpublic static String formatQuantity(Integer quantity)
quantity - The quantity Integer to be formattedpublic static String formatQuantity(int quantity)
quantity - The quantity int to be formattedpublic static String formatQuantity(Float quantity)
quantity - The quantity Float to be formattedpublic static String formatQuantity(float quantity)
quantity - The quantity float to be formattedpublic static String formatQuantity(Double quantity)
quantity - The quantity Double to be formattedpublic static String formatQuantity(double quantity)
quantity - The quantity double to be formattedpublic static String formatDate(Timestamp timestamp)
timestamp - String timestamp to be formattedpublic static String makeString(Object obj1)
obj1 - The passed Objectpublic static String checkNull(String string1)
string1 - The passed Stringpublic static String checkNull(String string1, String string2)
string1 - The first passed Stringstring2 - The second passed Stringpublic static String checkNull(String string1, String string2, String string3)
string1 - The first passed Stringstring2 - The second passed Stringstring3 - The third passed Stringpublic static String checkNull(String string1, String string2, String string3, String string4)
string1 - The first passed Stringstring2 - The second passed Stringstring3 - The third passed Stringstring4 - The fourth passed Stringpublic static String ifNotEmpty(String base, String pre, String post)
pre + base + post if base String is not null or empty, otherwise an empty but non-null String.base - The base Stringpre - The pre Stringpost - The post Stringpre + base + post if base String is not null or empty, otherwise an empty but non-null String.public static String checkEmpty(String string1, String string2)
string1 - The first passed Stringstring2 - The second passed Stringpublic static String checkEmpty(String string1, String string2, String string3)
string1 - The first passed Stringstring2 - The second passed Stringstring3 - The third passed Stringpublic static String encodeQuery(String query)
query - The plain query Stringpublic static String encodeQueryValue(String query)
query - The plain query value Stringpublic static String replaceString(String mainString, String oldString, String newString)
mainString - The original stringoldString - The string to replacenewString - The string to insert in place of the oldpublic static String decodeQueryValue(String query)
query - The encoded query value StringCopyright © 2015 Atlassian. All rights reserved.