Package net.bytebuddy.dynamic.scaffold
Class MethodGraph.Compiler.Default.Key.Store<V>
java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodGraph.Compiler.Default.Key.Store<V>
- Type Parameters:
V
- The type of the token used for deciding on method equality.
- Enclosing class:
MethodGraph.Compiler.Default.Key<S>
A store for collected methods that are identified by keys.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
An entry of a key store.protected static class
A graph implementation based on a key store. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LinkedHashMap
<MethodGraph.Compiler.Default.Key.Harmonized<V>, MethodGraph.Compiler.Default.Key.Store.Entry<V>> A mapping of harmonized keys to their represented entry. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Store()
Creates an empty store.private
Store
(LinkedHashMap<MethodGraph.Compiler.Default.Key.Harmonized<V>, MethodGraph.Compiler.Default.Key.Store.Entry<V>> entries) Creates a new store representing the given entries. -
Method Summary
Modifier and TypeMethodDescriptionprotected MethodGraph
Transforms this store into a method graph by applying the given merger.private static <W> MethodGraph.Compiler.Default.Key.Store.Entry
<W> combine
(MethodGraph.Compiler.Default.Key.Store.Entry<W> left, MethodGraph.Compiler.Default.Key.Store.Entry<W> right) Combines the two given stores.protected MethodGraph.Compiler.Default.Key.Store
<V> Combines this store with the given store.protected MethodGraph.Compiler.Default.Key.Store
<V> Injects the given store into this store.protected MethodGraph.Compiler.Default.Key.Store
<V> registerTopLevel
(List<? extends MethodDescription> methodDescriptions, MethodGraph.Compiler.Default.Harmonizer<V> harmonizer) Registers a new top level method within this store.
-
Field Details
-
entries
private final LinkedHashMap<MethodGraph.Compiler.Default.Key.Harmonized<V>,MethodGraph.Compiler.Default.Key.Store.Entry<V>> entriesA mapping of harmonized keys to their represented entry.
-
-
Constructor Details
-
Store
protected Store()Creates an empty store. -
Store
private Store(LinkedHashMap<MethodGraph.Compiler.Default.Key.Harmonized<V>, MethodGraph.Compiler.Default.Key.Store.Entry<V>> entries) Creates a new store representing the given entries.- Parameters:
entries
- A mapping of harmonized keys to their represented entry.
-
-
Method Details
-
combine
private static <W> MethodGraph.Compiler.Default.Key.Store.Entry<W> combine(MethodGraph.Compiler.Default.Key.Store.Entry<W> left, MethodGraph.Compiler.Default.Key.Store.Entry<W> right) Combines the two given stores.- Type Parameters:
W
- The type of the harmonized key of both stores.- Parameters:
left
- The left store to be combined.right
- The right store to be combined.- Returns:
- An entry representing the combination of both stores.
-
registerTopLevel
protected MethodGraph.Compiler.Default.Key.Store<V> registerTopLevel(List<? extends MethodDescription> methodDescriptions, MethodGraph.Compiler.Default.Harmonizer<V> harmonizer) Registers a new top level method within this store.- Parameters:
methodDescriptions
- The methods to register.harmonizer
- The harmonizer to use for determining method equality.- Returns:
- A store with the given method registered as a top-level method.
-
combineWith
protected MethodGraph.Compiler.Default.Key.Store<V> combineWith(MethodGraph.Compiler.Default.Key.Store<V> store) Combines this store with the given store.- Parameters:
store
- The store to combine with this store.- Returns:
- A store representing a combination of this store and the given store.
-
inject
protected MethodGraph.Compiler.Default.Key.Store<V> inject(MethodGraph.Compiler.Default.Key.Store<V> store) Injects the given store into this store.- Parameters:
store
- The key store to inject into this store.- Returns:
- A store that represents this store with the given store injected.
-
asGraph
Transforms this store into a method graph by applying the given merger.- Parameters:
merger
- The merger to apply for resolving the representative for ambiguous resolutions.- Returns:
- The method graph that represents this key store.
-