|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.espirit.firstspirit.aspects.AspectMap
public final class AspectMap
A simple map for type safe aspect mapping.
Constructor Summary | |
---|---|
AspectMap()
|
Method Summary | ||
---|---|---|
|
get(AspectType<A> type)
Get the correctly typed aspect for a type. |
|
|
put(AspectType<A> type,
C aspect)
Put an aspect for specific type. |
|
void |
remove(AspectType<?> type)
Remove the aspect for the given type from this map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AspectMap()
Method Detail |
---|
public final <A,C extends A> void put(@NotNull AspectType<A> type, @NotNull C aspect)
Example:
String aspect = ...;
AspectType<CharSequence> type = ...;
put(type, aspect);
A
- The type of the aspect.C
- The concrete implementation type of the aspect.type
- The aspect type.aspect
- The aspect implementation.public final void remove(AspectType<?> type)
type
- The aspect type.public final <A> A get(AspectType<A> type)
Example
AspectType<CharSequence> type = ...;
CharSequence aspect = get(type);
A
- The type of the aspect.type
- The aspect type to look up.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |