Package com.tngtech.archunit.core.domain
Class AccessTarget.FieldAccessTarget
java.lang.Object
com.tngtech.archunit.core.domain.AccessTarget
com.tngtech.archunit.core.domain.AccessTarget.FieldAccessTarget
- All Implemented Interfaces:
HasDescription
,CanBeAnnotated
,HasName
,HasName.AndFullName
,HasOwner<JavaClass>
,HasType
- Enclosing class:
- AccessTarget
public static final class AccessTarget.FieldAccessTarget extends AccessTarget implements HasType
Represents an
AccessTarget
where the target is a field. For further elaboration about the necessity to distinguish
FieldAccessTarget
from JavaField
, refer to the documentation at AccessTarget
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessTarget.FieldAccessTarget.Functions
Nested classes/interfaces inherited from class com.tngtech.archunit.core.domain.AccessTarget
AccessTarget.CodeUnitCallTarget, AccessTarget.ConstructorCallTarget, AccessTarget.FieldAccessTarget, AccessTarget.MethodCallTarget, AccessTarget.Predicates
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.CanBeAnnotated
CanBeAnnotated.Utils
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasName
HasName.AndFullName
Nested classes/interfaces inherited from interface com.tngtech.archunit.core.domain.properties.HasType
HasType.Predicates
-
Method Summary
Modifier and Type Method Description java.lang.String
getDescription()
JavaClass
getRawType()
JavaType
getType()
java.util.Set<JavaField>
resolve()
Tries to resolve the targeted members (methods, fields or constructors).Optional<JavaField>
resolveField()
Methods inherited from class com.tngtech.archunit.core.domain.AccessTarget
equals, getFullName, getName, getOwner, hashCode, isAnnotatedWith, isAnnotatedWith, isAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, isMetaAnnotatedWith, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Method Details
-
getType
-
getRawType
- Specified by:
getRawType
in interfaceHasType
-
resolveField
- Returns:
- A field that matches this target, or
Optional.absent()
if no matching field was imported.
-
resolve
Description copied from class:AccessTarget
Tries to resolve the targeted members (methods, fields or constructors). In most cases this will be a single element, if the target was imported, or an empty set, if the target was not imported. However, forMethodCallTargets
, there can be multiple possible targets. For further information refer toAccessTarget
.- Specified by:
resolve
in classAccessTarget
- Returns:
- Fields that match the target, this will always be either one field, or no field
- See Also:
resolveField()
-
getDescription
- Specified by:
getDescription
in interfaceHasDescription
-