public class FieldValidator extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Integer> |
fieldIdxMap
Map of field name to field index mappings. |
protected java.lang.String[] |
fieldNames
Array of field names.
|
| Modifier | Constructor and Description |
|---|---|
protected |
FieldValidator()
Protected constructor to ensure correct instantiation.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getArrayValue(java.lang.String[] array,
int idx)
Checks to if the index is out of bounds in the give array and also
if the value if null or empty.
|
static FieldValidator |
prepare(java.lang.String[] fieldNames)
Prepares a validator for use on a given set of fields.
|
protected java.lang.String[] fieldNames
protected java.util.Map<java.lang.String,java.lang.Integer> fieldIdxMap
Map of field name to field index mappings.protected FieldValidator()
public static FieldValidator prepare(java.lang.String[] fieldNames)
fieldNames - array of field names.public static java.lang.String getArrayValue(java.lang.String[] array, int idx)
array - source value arrayidx - desired index into arrayCopyright © 2011–2023. All rights reserved.