Class PaginatedTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.model.traits.PaginatedTrait
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToShapeId,Trait,software.amazon.smithy.utils.ToSmithyBuilder<PaginatedTrait>
public final class PaginatedTrait
extends AbstractTrait
implements software.amazon.smithy.utils.ToSmithyBuilder<PaginatedTrait>
Defines the pagination functionality of an operation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds the paginated trait.static final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic PaginatedTrait.Builderbuilder()protected NodeThe result of toNode is used for hashCodes and equality.getItems()merge(PaginatedTrait other) Merges this paginated trait with another trait.static List<MemberShape>resolveFullPath(String path, Model model, StructureShape shape) Resolves an output path to a list ofMemberShape.static Optional<MemberShape>resolvePath(String path, Model model, StructureShape shape) Deprecated.Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
Field Details
-
ID
-
-
Method Details
-
getItems
- Returns:
- The `items` property of the trait.
-
getInputToken
- Returns:
- The `inputToken` property of the trait.
-
getOutputToken
- Returns:
- The `outputToken` property of the trait.
-
getPageSize
- Returns:
- The optional `pageSize` property.
-
resolvePath
@Deprecated public static Optional<MemberShape> resolvePath(String path, Model model, StructureShape shape) Deprecated.This method only returns the lastMemberShapeof an output path. To resolve each path identifier to it's respectiveMemberShapeseeresolveFullPath(java.lang.String, software.amazon.smithy.model.Model, software.amazon.smithy.model.shapes.StructureShape)Resolves an output path.A path is a series of identifiers separated by dots (`.`) where each identifier represents a member name in a structure.
- Parameters:
path- The path to resolve.model- The model to be searched when resolving the path.shape- The shape where path resolution should start, e.g. the output shape of an operation.- Returns:
- The optional member shape that the path resolves to.
-
resolveFullPath
Resolves an output path to a list ofMemberShape.A path is a series of identifiers separated by dots (`.`) where each identifier represents a member name in a structure.
- Parameters:
path- The path to resolve.model- The model to be searched when resolving the path.shape- The shape where path resolution should start, e.g. the output shape of an operation.- Returns:
- The list of member shapes corresponding to each path identifier. An unresolvable path will be returned as an empty list.
-
merge
Merges this paginated trait with another trait.Values set on this trait take precedence over values of the other trait. This operation is typically performed to merge the paginated trait of an operation with the paginated trait of a service.
If
otheris null, the current trait is returned as-is.- Parameters:
other- Other trait to merge with.- Returns:
- Returns a newly created trait that maintains the same source location.
-
createNode
Description copied from class:AbstractTraitThe result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNodein classAbstractTrait- Returns:
- Returns the trait as a node.
-
toBuilder
- Specified by:
toBuilderin interfacesoftware.amazon.smithy.utils.ToSmithyBuilder<PaginatedTrait>
-
builder
- Returns:
- Returns a paginated trait builder.
-
MemberShapeof an output path.