public class CustomFieldHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VALUE_SEPARATOR
Separator used when multiple values are parsed from a String
|
| Constructor and Description |
|---|
CustomFieldHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
fillNewFieldValue(CustomFieldDetailedVO field,
CustomFieldValueDTO customValue)
Fills-in a new custom field value instance for a new value on the given field.
|
static UserProfileFieldActions |
findActions(ProfileField profileField,
java.lang.Iterable<UserProfileFieldActions> actions)
Returns the actions collection for the given profile field
|
static <PV extends ICustomFieldPossibleValue<?>> |
findPossibleValue(java.lang.String value,
java.util.List<PV> possibleValues)
Finds the possible value with a given value, or returns null if not found
|
static <V extends ICustomFieldValue<?,?>> |
findValue(ICustomField field,
java.util.Collection<? extends V> values)
Finds a custom field value inside a collection
|
static CustomFieldValueDTO |
findValueOrNew(CustomFieldDetailedVO field,
java.util.Collection<CustomFieldValueDTO> customValues)
Finds a custom field value inside a collection.
|
static java.util.List<CustomFieldDetailedVO> |
getCustomFields(java.lang.Iterable<UserProfileFieldActions> actions)
Returns the custom fields in the given collection of actions
|
static java.lang.Object |
getCustomFieldValue(CustomFieldType type,
ICustomFieldValue value)
Returns the property used to retrieve the value of a field given it's type
|
static java.lang.Object |
getCustomFieldValue(ICustomFieldValue<?,?> value)
Returns the property used to retrieve the value of a field given it's type
|
static java.lang.Object |
getDefaultValue(CustomFieldDetailedVO field)
Returns the default value for the given field
|
static java.util.Collection<CustomFieldPossibleValueVO> |
getEnumeratedValues(ICustomFieldValue<?,?> fieldValue) |
static ProfileField |
getProfileField(UserProfileFieldActions actions)
Returns the profile field for the given actions collection
|
static java.lang.String |
getReferenceValue(ICustomFieldValue<?,?> fieldValue) |
static java.lang.Object |
getValue(java.lang.Long customFieldId,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues)
Returns the value of a custom field from a collection, finding the value by internal name.
|
static java.lang.Object |
getValue(java.lang.String internalName,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues)
Returns the value of a custom field from a collection, finding the value by internal name.
|
static java.lang.Object |
getValue(UserWithFieldsVO user,
ProfileField profileField)
Returns a profile field value for a given
UserWithFieldsVO |
static boolean |
hasAnyFieldWithInformation(java.util.Collection<UserProfileFieldActions> profileFieldActions)
Returns whether at least one of the given fields have information text
|
static CustomFieldValueDTO |
newFieldValue(CustomFieldDetailedVO field)
Creates a new custom field value for the given field
|
static void |
qualifyInternalName(java.lang.String customFieldInternalName,
CustomFieldPossibleValueVO possibleValue)
Qualifies the internal name of the given possible value with the custom field internal name.
|
static void |
setCustomFieldValue(ICustomFieldValue<?,?> fieldValue,
java.lang.Object value)
Returns the property used to retrieve the value of a field given it's type
|
static boolean |
setValue(java.lang.String internalName,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues,
java.lang.Object value)
Sets the value of a custom field given the values collection, finding by field internal name
|
static java.util.Map<java.lang.String,ICustomField> |
toFieldsMap(java.util.Collection<? extends ICustomField> fields)
Returns a Map, keyed by the custom field's unqualified internal name , whose value is the custom field of the
received
collection.
|
static java.util.Map<ICustomField,ICustomFieldValue> |
toMap(java.util.Collection<? extends ICustomFieldValue> customValues)
Returns a Map, keyed by the custom field , whose values are the custom field values of the received collection.
|
static java.lang.String |
toReference(ICustomFieldValue<CustomFieldValueFileVO,CustomFieldValueImageVO> fieldValue)
Converts a
ICustomFieldValue to a reference, that is, a string representation |
public static java.lang.String VALUE_SEPARATOR
public static void fillNewFieldValue(CustomFieldDetailedVO field, CustomFieldValueDTO customValue)
CustomFieldValueDTO and newFieldValue(CustomFieldDetailedVO) is not enough. Sets the field
reference and the default value.public static UserProfileFieldActions findActions(ProfileField profileField, java.lang.Iterable<UserProfileFieldActions> actions)
public static <PV extends ICustomFieldPossibleValue<?>> PV findPossibleValue(java.lang.String value, java.util.List<PV> possibleValues)
public static <V extends ICustomFieldValue<?,?>> V findValue(ICustomField field, java.util.Collection<? extends V> values)
public static CustomFieldValueDTO findValueOrNew(CustomFieldDetailedVO field, java.util.Collection<CustomFieldValueDTO> customValues)
public static java.util.List<CustomFieldDetailedVO> getCustomFields(java.lang.Iterable<UserProfileFieldActions> actions)
public static java.lang.Object getCustomFieldValue(CustomFieldType type, ICustomFieldValue value)
public static java.lang.Object getCustomFieldValue(ICustomFieldValue<?,?> value)
public static java.lang.Object getDefaultValue(CustomFieldDetailedVO field)
public static java.util.Collection<CustomFieldPossibleValueVO> getEnumeratedValues(ICustomFieldValue<?,?> fieldValue)
public static ProfileField getProfileField(UserProfileFieldActions actions)
public static java.lang.String getReferenceValue(ICustomFieldValue<?,?> fieldValue)
public static java.lang.Object getValue(java.lang.Long customFieldId,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues)
public static java.lang.Object getValue(java.lang.String internalName,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues)
public static java.lang.Object getValue(UserWithFieldsVO user, ProfileField profileField)
UserWithFieldsVOpublic static boolean hasAnyFieldWithInformation(java.util.Collection<UserProfileFieldActions> profileFieldActions)
public static CustomFieldValueDTO newFieldValue(CustomFieldDetailedVO field)
public static void qualifyInternalName(java.lang.String customFieldInternalName,
CustomFieldPossibleValueVO possibleValue)
public static void setCustomFieldValue(ICustomFieldValue<?,?> fieldValue, java.lang.Object value)
public static boolean setValue(java.lang.String internalName,
java.util.Collection<? extends ICustomFieldValue<?,?>> customValues,
java.lang.Object value)
public static java.util.Map<java.lang.String,ICustomField> toFieldsMap(java.util.Collection<? extends ICustomField> fields)
public static java.util.Map<ICustomField,ICustomFieldValue> toMap(java.util.Collection<? extends ICustomFieldValue> customValues)
public static java.lang.String toReference(ICustomFieldValue<CustomFieldValueFileVO,CustomFieldValueImageVO> fieldValue)
ICustomFieldValue to a reference, that is, a string representation