Class BottomUpIndex
java.lang.Object
software.amazon.smithy.model.knowledge.BottomUpIndex
- All Implemented Interfaces:
KnowledgeIndex
Computes all of the parent shapes of resources and operations from the bottom-up.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAllParents
(ToShapeId service, ToShapeId operationOrResource) Gets all of the parents of an operation or resource within a service.getEntityBinding
(ToShapeId service, ToShapeId operationOrResource) Gets the direct parent of an operation or resource.getResourceBinding
(ToShapeId service, ToShapeId operationOrResource) Gets the direct parent resource of an operation or resource if and only if the given resource or operation is bound to a resource and not bound to a service.static BottomUpIndex
-
Constructor Details
-
BottomUpIndex
-
-
Method Details
-
of
-
getAllParents
Gets all of the parents of an operation or resource within a service.The returned list contains each
EntityShape
parent (a resource or service shape). The first element in the list is the direct parent of the resource/operation, followed by that resource's parent, until finally the last element in the list is always aServiceShape
.- Parameters:
service
- Service to query.operationOrResource
- The operation or resource for which to find the parents.- Returns:
- Returns the parents of the resource.
-
getEntityBinding
Gets the direct parent of an operation or resource.- Parameters:
service
- Service closure to query.operationOrResource
- The operation or resource to query.- Returns:
- Returns the optionally found parent, a resource or service shape.
-
getResourceBinding
Gets the direct parent resource of an operation or resource if and only if the given resource or operation is bound to a resource and not bound to a service.- Parameters:
service
- Service closure to query.operationOrResource
- The operation or resource to query.- Returns:
- Returns the optionally found parent resource.
-