public class Aspects extends Object
| Constructor and Description |
|---|
Aspects() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
aspectOf(Class<T> aspectClass) |
static <T> T |
aspectOf(Class<T> aspectClass,
Class<?> perTypeWithin) |
static <T> T |
aspectOf(Class<T> aspectClass,
Object perObject) |
static boolean |
hasAspect(Class<?> aspectClass) |
static boolean |
hasAspect(Class<?> aspectClass,
Class<?> perTypeWithin) |
static boolean |
hasAspect(Class<?> aspectClass,
Object perObject) |
public static <T> T aspectOf(Class<T> aspectClass) throws NoAspectBoundException
T - the expected class of the aspectaspectClass - the aspect classNoAspectBoundException - if no such aspectpublic static <T> T aspectOf(Class<T> aspectClass, Object perObject) throws NoAspectBoundException
T - the expected class of the aspectaspectClass - the aspect classperObject - the this/target object for which to look for an aspect instanceNoAspectBoundException - if no such aspect, or no aspect boundpublic static <T> T aspectOf(Class<T> aspectClass, Class<?> perTypeWithin) throws NoAspectBoundException
T - the expected class of the aspectaspectClass - the aspect classperTypeWithin - the class for which to search for an aspect instanceNoAspectBoundException - if no such aspect, or no aspect boundpublic static boolean hasAspect(Class<?> aspectClass) throws NoAspectBoundException
aspectClass - the aspect classNoAspectBoundException - if not boundpublic static boolean hasAspect(Class<?> aspectClass, Object perObject) throws NoAspectBoundException
aspectClass - the aspect classperObject - the this/target object for which to look for an aspect instanceNoAspectBoundException - if not boundpublic static boolean hasAspect(Class<?> aspectClass, Class<?> perTypeWithin) throws NoAspectBoundException
aspectClass - the aspect classperTypeWithin - classNoAspectBoundException - if not boundCopyright © 2019. All rights reserved.