public class AttributeUtils extends Object
AttributeBuilder
.AttributeBuilder
Modifier and Type | Method and Description |
---|---|
static Optional<Attribute> |
getAttribute(String name,
List<Attribute> attributes)
Returns an attribute with a given name from an attribute list.
|
static String |
getAttributeStringValue(Attribute attribute)
Given a single-valued string attribute, this method returns its string value.
|
static List<String> |
getAttributeStringValues(Attribute attribute)
Given an attribute holding string values this method will return a list of these values.
|
static <T extends XMLObject> |
getAttributeValue(Attribute attribute,
Class<T> type)
Given a single-valued attribute, this method returns its value (of the given type).
|
static <T extends XMLObject> |
getAttributeValues(Attribute attribute,
Class<T> type)
Returns the attribute values of the given type.
|
public static List<String> getAttributeStringValues(Attribute attribute)
attribute
- the attributepublic static String getAttributeStringValue(Attribute attribute)
attribute
- the attributenull
if no value is storedpublic static <T extends XMLObject> List<T> getAttributeValues(Attribute attribute, Class<T> type)
T
- the value typeattribute
- the attributetype
- the type to matchpublic static <T extends XMLObject> T getAttributeValue(Attribute attribute, Class<T> type)
T
- the value typeattribute
- the attributetype
- the type to matchnull
Copyright © 2018 Litsec AB. All rights reserved.