public final class AttributeUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
appendIfNotNull(StringBuilder strBuilder,
Object val)
Appends the string representation of an object to a StringBuilder.
|
static boolean |
areDefinitionsEqual(com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> src,
com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> trgt)
Compares to attribute definition sets
|
static boolean |
checkMandatoryAttributes(IPersonalAttributeList personalAttrList)
Check if all mandatory attributes have values.
|
static com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> |
clone(com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> attributes)
Safecopy of attribute definitions into another set (clone)
|
static String |
escape(String value)
Safe escape any given string.
|
static String |
getMissingMandatoryAttributes(IPersonalAttributeList personalAttrList)
Obtain the list of missing mandatory attributes.
|
static boolean |
hasValidTuples(String[] tuples)
Validates the Personal attribute tuple.
|
static boolean |
isGenderAttributeDefinition(eu.eidas.auth.commons.attribute.AttributeDefinition<?> attributeDefinition)
Verify if the given attributeDefinition is an attribute definition of a Gender attribute.
|
static boolean |
isValidType(String type)
Validates the attribute type value.
|
static boolean |
isValidValue(String value)
Validates the attribute value format.
|
static String |
listToString(List<String> list,
String separator)
Given a separator and a list of strings, joins the list, as a string,
separated by the separator string.
|
static String |
mapToString(Map<String,String> map,
String separator)
Given a separator and a map of strings to strings, joins the map, as a
string, separated by the separator string with the pair key/value
concatenated with a '='.
|
static String |
unescape(String value)
Unescape any given string.
|
public static String escape(String value)
value
- The HTTP Value to escaped.public static String unescape(String value)
value
- The HTTP Value to be unescaped.public static void appendIfNotNull(StringBuilder strBuilder, Object val)
strBuilder
- The StringBuilder to append to.val
- The string representation of an object.public static String listToString(List<String> list, String separator)
list
- The list of strings to join.separator
- The separator string.public static String mapToString(Map<String,String> map, String separator)
map
- The map of strings to join.separator
- The separator string.public static boolean isValidValue(String value)
value
- The attribute value to validate.public static boolean isValidType(String type)
type
- The attribute type value.public static boolean hasValidTuples(String[] tuples)
tuples
- The Personal attribute's tuple.isValidType(String)
,
isValidValue(String)
,
String.equalsIgnoreCase(String)
public static boolean checkMandatoryAttributes(IPersonalAttributeList personalAttrList)
personalAttrList
- The Personal Attributes List.public static String getMissingMandatoryAttributes(IPersonalAttributeList personalAttrList)
personalAttrList
- The Personal Attributes List.public static com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> clone(com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> attributes)
attributes
- the attributes to be clonedpublic static boolean areDefinitionsEqual(com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> src, com.google.common.collect.ImmutableSortedSet<eu.eidas.auth.commons.attribute.AttributeDefinition<?>> trgt)
src
- the instance of ImmutableSortedSet
that holds one of the set of AttributeDefinition
to be comparedtrgt
- the instance of ImmutableSortedSet
that holds the other set of AttributeDefinition
to be comparedpublic static boolean isGenderAttributeDefinition(eu.eidas.auth.commons.attribute.AttributeDefinition<?> attributeDefinition)
attributeDefinition
- the attribute definition to checkCopyright © 2020. All Rights Reserved.