public abstract class PodamUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG
The application logger.
|
static char[] |
NICE_ASCII_CHARACTERS
An array of valid String characters
|
| Constructor and Description |
|---|
PodamUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<Annotation> |
getAttributeAnnotations(Field attribute,
Method setter)
Given the attribute and setter it combines annotations from them
or an empty collection if no custom annotations were found
|
static Field |
getField(Class<?> pojoClass,
String attributeName)
It returns a
Field matching the attribute name or null if a field
was not found. |
static <T> T |
getFieldValue(Object pojo,
String attributeName)
It returns an value for a
Field matching the attribute
name or null if a field was not found. |
static int |
getIntegerInRange(int minValue,
int maxValue)
It returns a random int/Integer value between min and max value (included).
|
static long |
getLongInRange(long minValue,
long maxValue)
It returns a long/Long value between min and max value (included).
|
static Character |
getNiceCharacter()
Generates random character from set valid for identifiers in Java language
|
static Class<?> |
primitiveToBoxedType(Class<?> primitiveType)
Finds boxed type for a primitive type
|
public static final char[] NICE_ASCII_CHARACTERS
private static final org.slf4j.Logger LOG
public static Field getField(Class<?> pojoClass, String attributeName)
Field matching the attribute name or null if a field
was not found.pojoClass - The class supposed to contain the fieldattributeName - The field nameField matching the attribute name or null if a field
was not found.public static <T> T getFieldValue(Object pojo, String attributeName)
Field matching the attribute
name or null if a field was not found.T - The type of field to be returnedpojo - The class supposed to contain the fieldattributeName - The field nameField matching the attribute name or
null if a field was not found.public static List<Annotation> getAttributeAnnotations(Field attribute, Method setter)
attribute - The class attributesetter - The class attribute'sĀ setterpublic static Character getNiceCharacter()
public static long getLongInRange(long minValue,
long maxValue)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valuepublic static int getIntegerInRange(int minValue,
int maxValue)
minValue - The minimum value for the returned valuemaxValue - The maximum value for the returned valueCopyright © 2016. All rights reserved.