Package aQute.bnd.header
Class Attrs
java.lang.Object
aQute.bnd.header.Attrs
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Attrs.DataType<Double> static final Attrsstatic final Attrs.DataType<List<Double>> static final Attrs.DataType<List<Long>> static final Attrs.DataType<List<String>> static final Attrs.DataType<List<Version>> static final Attrs.DataType<Long> static final Attrs.DataType<String> static final PatternPattern for List with list typestatic final Attrs.DataType<Version> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aliases for all directives.voidappend(StringBuilder sb) voidappend(StringBuilder sb, Map.Entry<String, String> e) voidclear()booleancontainsKey(Object name) Deprecated.booleancontainsKey(String name) booleancontainsValue(Object value) Deprecated.booleancontainsValue(String value) static Objectconvert(Attrs.Type t, String s) static Objectstatic AttrsentrySet()booleanDeprecated.voidforEach(BiConsumer<? super String, ? super String> action) Deprecated.<T> TgetTyped(Attrs.DataType<T> type, String adname) inthashCode()Deprecated.static booleanisAttribute(String key) Predicate which returns true if the specified key is an attribute key.static booleanisDirective(String key) Predicate which returns true if the specified key is a directive key.booleanisEmpty()booleankeySet()voidMerge the attributesput(String key, Attrs.Type type, String value) voidvoidvoidputAllTyped(Map<? extends String, ? extends Object> attrs) voidDeprecated.Return a new Attrs that has only the attributes that match the predicate.intsize()stream()static StringtoDirective(String key) Check if a directive, if so, return directive name otherwise nulltoString()static Attrs.TypetoTyped()Return this attrs as typed valuesxvalues()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
STRING
-
LONG
-
DOUBLE
-
VERSION
-
LIST_STRING
-
LIST_LONG
-
LIST_DOUBLE
-
LIST_VERSION
-
TYPED
Pattern for List with list type -
EMPTY_ATTRS
-
-
Constructor Details
-
Attrs
public Attrs() -
Attrs
-
Attrs
-
Attrs
-
-
Method Details
-
putAllTyped
-
putTyped
-
clear
public void clear() -
containsKey
-
containsKey
Deprecated.- Specified by:
containsKeyin interfaceMap<String,String>
-
containsValue
-
containsValue
Deprecated.- Specified by:
containsValuein interfaceMap<String,String>
-
entrySet
-
stream
-
forEach
-
get
Deprecated. -
get
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
put
-
getType
-
putAll
-
putAll
-
remove
Deprecated. -
remove
-
size
public int size() -
values
-
getVersion
-
toString
-
append
-
append
-
toString
-
equals
Deprecated. -
hashCode
Deprecated. -
isEqual
-
toTyped
Return this attrs as typed valuesx -
getTyped
-
getTyped
-
toType
-
convert
-
convert
-
mergeWith
Merge the attributes -
toDirective
Check if a directive, if so, return directive name otherwise null -
isAttribute
Predicate which returns true if the specified key is an attribute key. -
isDirective
Predicate which returns true if the specified key is a directive key. -
create
-
with
-
select
Return a new Attrs that has only the attributes that match the predicate. The primary use case for this is AttributeClasses.- Parameters:
predicate- a predicate that returns true if the attribute must be included in the result- Returns:
- a new Attrs that can be used and modified by the caller
-
addDirectiveAliases
public void addDirectiveAliases()Add aliases for all directives. In some cases, like annotations, directives cannot have their ':' at the end. In that case we create an alias without the ':'. We only create an alias for a directive when there is no attribute with that value.
-