Interface TargetResolver
- All Known Implementing Classes:
TargetResolverImpl
public interface TargetResolver
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisContainerTarget(Target target) Returns true if object is aTargetfor a container being used to check operations on a different childTargetTypewithin it.<T> @NonNull com.atlassian.fugue.Option<T>resolveContainerHibernateObject(Target target, Class<T> expectedType) Get the target hibernate object for the container relating to the specified target.<T> @NonNull com.atlassian.fugue.Option<T>resolveHibernateObject(Target target, Class<T> expectedType) Get the target hibernate object, if this target is one that has a specific object (not a container)<T> @NonNull TresolveModelObject(Target target, Class<T> expectedType) Get the target model object (e.g.
-
Method Details
-
resolveModelObject
Get the target model object (e.g. Content), if this target is one that has a specific model object (not a container)- Type Parameters:
T- the class type to cast the model object to after resolving the target to a model object- Returns:
- the result of resolving the model object, cast to T
- Throws:
UnsupportedTargetException- if target is an unsupported type for resolving model objects, or is a container targetBadRequestException
-
resolveHibernateObject
<T> @NonNull com.atlassian.fugue.Option<T> resolveHibernateObject(Target target, Class<T> expectedType) Get the target hibernate object, if this target is one that has a specific object (not a container)- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- Throws:
UnsupportedTargetException- if target is an unsupported type for resolving hibernate objects (e.g. is a container target)BadRequestException- See Also:
-
resolveContainerHibernateObject
<T> @NonNull com.atlassian.fugue.Option<T> resolveContainerHibernateObject(Target target, Class<T> expectedType) Get the target hibernate object for the container relating to the specified target.- If this target is a container target, get that container's hibernate object.
- If this target is one that has a specific object (not a container), get that object's container's hibernate object.
- Returns:
- an option containing the hibernate object, or an empty option if the types are correct but the hibernate ID doesn't exist in the database
- Throws:
UnsupportedTargetException- if target is an unsupported type for resolving container hibernate objects (e.g. not a container target, or is an unsuitable kind of model object)BadRequestException- See Also:
-
isContainerTarget
Returns true if object is aTargetfor a container being used to check operations on a different childTargetTypewithin it.- Returns:
- true if it's a container target, false otherwise
- See Also:
-