Class PaginatedTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.model.traits.PaginatedTrait
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
,ToSmithyBuilder<PaginatedTrait>
public final class PaginatedTrait extends AbstractTrait implements ToSmithyBuilder<PaginatedTrait>
Defines the pagination functionality of an operation.- See Also:
PaginatedTraitValidator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PaginatedTrait.Builder
Builds the paginated trait.static class
PaginatedTrait.Provider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static PaginatedTrait.Builder
builder()
protected Node
createNode()
The result of toNode is used for hashCodes and equality.java.util.Optional<java.lang.String>
getInputToken()
java.util.Optional<java.lang.String>
getItems()
java.util.Optional<java.lang.String>
getOutputToken()
java.util.Optional<java.lang.String>
getPageSize()
PaginatedTrait
merge(PaginatedTrait other)
Merges this paginated trait with another trait.static java.util.List<MemberShape>
resolveFullPath(java.lang.String path, Model model, StructureShape shape)
Resolves an output path to a list ofMemberShape
.static java.util.Optional<MemberShape>
resolvePath(java.lang.String path, Model model, StructureShape shape)
Deprecated.This method only returns the lastMemberShape
of an output path.PaginatedTrait.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
-
-
-
Field Detail
-
ID
public static final ShapeId ID
-
-
Method Detail
-
getItems
public java.util.Optional<java.lang.String> getItems()
- Returns:
- The `items` property of the trait.
-
getInputToken
public java.util.Optional<java.lang.String> getInputToken()
- Returns:
- The `inputToken` property of the trait.
-
getOutputToken
public java.util.Optional<java.lang.String> getOutputToken()
- Returns:
- The `outputToken` property of the trait.
-
getPageSize
public java.util.Optional<java.lang.String> getPageSize()
- Returns:
- The optional `pageSize` property.
-
resolvePath
@Deprecated public static java.util.Optional<MemberShape> resolvePath(java.lang.String path, Model model, StructureShape shape)
Deprecated.This method only returns the lastMemberShape
of an output path. To resolve each path identifier to it's respectiveMemberShape
seeresolveFullPath(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
public static java.util.List<MemberShape> resolveFullPath(java.lang.String path, Model model, StructureShape shape)
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
public PaginatedTrait merge(PaginatedTrait other)
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
other
is 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
protected Node createNode()
Description copied from class:AbstractTrait
The 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:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-
toBuilder
public PaginatedTrait.Builder toBuilder()
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<PaginatedTrait>
- Returns:
- a builder for type T
-
builder
public static PaginatedTrait.Builder builder()
- Returns:
- Returns a paginated trait builder.
-
-