Package aQute.bnd.osgi
Class Instructions
- java.lang.Object
-
- aQute.bnd.osgi.Instructions
-
- All Implemented Interfaces:
java.util.Map<Instruction,Attrs>
public class Instructions extends java.lang.Object implements java.util.Map<Instruction,Attrs>
-
-
Field Summary
Fields Modifier and Type Field Description static InstructionsALWAYS(package private) static java.util.Map<Instruction,Attrs>EMPTYprivate java.util.LinkedHashMap<Instruction,Attrs>map
-
Constructor Summary
Constructors Constructor Description Instructions()Instructions(Parameters contained)Instructions(Instructions other)Instructions(java.lang.String h)Instructions(java.util.Collection<java.lang.String> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidappend(Parameters other)voidappendIfAbsent(Parameters other)voidclear()booleancontainsKey(Instruction name)booleancontainsKey(java.lang.Object name)Deprecated.booleancontainsValue(Attrs value)booleancontainsValue(java.lang.Object value)Deprecated.voiddecorate(Parameters parameters)Match the instruction against the parameters and merge the attributes if matches.voiddecorate(Parameters parameters, boolean addLiterals)Match the instruction against the parameters and merge the attributes if matches.java.util.Set<java.util.Map.Entry<Instruction,Attrs>>entrySet()Instructionfinder(java.lang.String value)Attrsget(Instruction key)Attrsget(java.lang.Object key)Deprecated.booleanisEmpty()java.util.Set<Instruction>keySet()Instructionmatcher(java.lang.String value)booleanmatches(java.lang.String value)MapStream<Instruction,Attrs>matchesStream(java.lang.String value)Attrsput(Instruction key, Attrs value)voidputAll(java.util.Map<? extends Instruction,? extends Attrs> map)<T> java.util.Collection<T>reject(java.util.Collection<T> set)Attrsremove(Instruction var0)Attrsremove(java.lang.Object var0)Deprecated.java.util.Map<java.io.File,Attrs>select(java.io.File base)Deprecated.java.util.Map<java.io.File,java.util.List<Attrs>>select(java.io.File base, java.util.function.Function<java.lang.String,java.lang.String> mapper, java.util.Set<Instruction> missing)Turn this Instructions into a map of File -> Attrs.<T> java.util.Collection<T>select(java.util.Collection<T> set, boolean emptyIsAll)<T> java.util.Collection<T>select(java.util.Collection<T> set, java.util.Set<Instruction> unused, boolean emptyIsAll)intsize()MapStream<Instruction,Attrs>stream()java.lang.StringtoString()java.util.Collection<Attrs>values()
-
-
-
Field Detail
-
map
private java.util.LinkedHashMap<Instruction,Attrs> map
-
ALWAYS
public static Instructions ALWAYS
-
EMPTY
static java.util.Map<Instruction,Attrs> EMPTY
-
-
Constructor Detail
-
Instructions
public Instructions(Instructions other)
-
Instructions
public Instructions(java.util.Collection<java.lang.String> other)
-
Instructions
public Instructions()
-
Instructions
public Instructions(Parameters contained)
-
Instructions
public Instructions(java.lang.String h)
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Map<Instruction,Attrs>
-
containsKey
public boolean containsKey(Instruction name)
-
containsKey
@Deprecated public boolean containsKey(java.lang.Object name)
Deprecated.- Specified by:
containsKeyin interfacejava.util.Map<Instruction,Attrs>
-
containsValue
public boolean containsValue(Attrs value)
-
containsValue
@Deprecated public boolean containsValue(java.lang.Object value)
Deprecated.- Specified by:
containsValuein interfacejava.util.Map<Instruction,Attrs>
-
entrySet
public java.util.Set<java.util.Map.Entry<Instruction,Attrs>> entrySet()
- Specified by:
entrySetin interfacejava.util.Map<Instruction,Attrs>
-
stream
public MapStream<Instruction,Attrs> stream()
-
get
@Deprecated public Attrs get(java.lang.Object key)
Deprecated.- Specified by:
getin interfacejava.util.Map<Instruction,Attrs>
-
get
public Attrs get(Instruction key)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Map<Instruction,Attrs>
-
keySet
public java.util.Set<Instruction> keySet()
- Specified by:
keySetin interfacejava.util.Map<Instruction,Attrs>
-
put
public Attrs put(Instruction key, Attrs value)
- Specified by:
putin interfacejava.util.Map<Instruction,Attrs>
-
putAll
public void putAll(java.util.Map<? extends Instruction,? extends Attrs> map)
- Specified by:
putAllin interfacejava.util.Map<Instruction,Attrs>
-
remove
@Deprecated public Attrs remove(java.lang.Object var0)
Deprecated.- Specified by:
removein interfacejava.util.Map<Instruction,Attrs>
-
remove
public Attrs remove(Instruction var0)
-
size
public int size()
- Specified by:
sizein interfacejava.util.Map<Instruction,Attrs>
-
values
public java.util.Collection<Attrs> values()
- Specified by:
valuesin interfacejava.util.Map<Instruction,Attrs>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
append
public void append(Parameters other)
-
appendIfAbsent
public void appendIfAbsent(Parameters other)
-
select
public <T> java.util.Collection<T> select(java.util.Collection<T> set, boolean emptyIsAll)
-
select
public <T> java.util.Collection<T> select(java.util.Collection<T> set, java.util.Set<Instruction> unused, boolean emptyIsAll)
-
reject
public <T> java.util.Collection<T> reject(java.util.Collection<T> set)
-
matcher
public Instruction matcher(java.lang.String value)
-
finder
public Instruction finder(java.lang.String value)
-
matches
public boolean matches(java.lang.String value)
-
matchesStream
public MapStream<Instruction,Attrs> matchesStream(java.lang.String value)
-
select
@Deprecated public java.util.Map<java.io.File,Attrs> select(java.io.File base)
Deprecated.Turn this Instructions into a map of File -> Attrs. You can specify a base directory, which will match all files in that directory against the specification or you can use literal instructions to get files from anywhere.- Parameters:
base- The directory to list files from.- Returns:
- The map that links files to attributes
-
select
public java.util.Map<java.io.File,java.util.List<Attrs>> select(java.io.File base, java.util.function.Function<java.lang.String,java.lang.String> mapper, java.util.Set<Instruction> missing)
Turn this Instructions into a map of File -> Attrs. You can specify a base directory, which will match all files in that directory against the specification or you can use literal instructions to get files from anywhere.A mapping function can be provided to rename literal names. This was added to map '.' and '' to 'bnd.bnd'. However, this can be generally useful.
- Parameters:
base- The directory to list files from.mapper- Maps the literal names.- Returns:
- The map that links files to attributes
-
decorate
public void decorate(Parameters parameters)
Match the instruction against the parameters and merge the attributes if matches. Remove any negated instructions. Literal unmatched instructions are not added- Parameters:
parameters- the parameters to decorate
-
decorate
public void decorate(Parameters parameters, boolean addLiterals)
Match the instruction against the parameters and merge the attributes if matches. Remove any negated instructions. Literal unmatched instructions are added if the addLiterals is true- Parameters:
parameters- the parameters to decorateaddLiterals- add literals to the output
-
-