Class PaginatorsClassSpec

    • Method Detail

      • requestType

        protected com.squareup.javapoet.ClassName requestType()
        Returns:
        A Poet ClassName for the operation request type. Example: For ListTables operation, it will be "ListTablesRequest" class.
      • responseType

        protected com.squareup.javapoet.ClassName responseType()
        Returns:
        A Poet ClassName for the sync operation response type. Example: For ListTables operation, it will be "ListTablesResponse" class.
      • requestClassField

        protected com.squareup.javapoet.FieldSpec requestClassField()
      • nextPageFetcherClassName

        protected String nextPageFetcherClassName()
      • resumeMethodBuilder

        protected com.squareup.javapoet.MethodSpec.Builder resumeMethodBuilder()
      • getTypeForResultKey

        protected com.squareup.javapoet.TypeName getTypeForResultKey​(String singleResultKey)
      • memberModelForResponseMember

        protected MemberModel memberModelForResponseMember​(String input)
        Parameters:
        input - A top level or nested member in response of c2jOperationName.
        Returns:
        The MemberModel of the PaginatorDefinition.getResultKey(). If input value is nested, then member model of the last child shape is returned. For example, if input is StreamDescription.Shards, then the return value is "Shard" which is the member model for the Shards.
      • hasNextPageMethodBody

        protected com.squareup.javapoet.CodeBlock hasNextPageMethodBody()
      • nextPageMethodBody

        protected com.squareup.javapoet.CodeBlock nextPageMethodBody()
      • codeToGetNextPageIfOldResponseIsNotNull

        protected String codeToGetNextPageIfOldResponseIsNotNull()
        Generates the code to get next page by using values from old page. Sample generated code: return client.listTables(firstRequest.toBuilder().exclusiveStartTableName(response.lastEvaluatedTableName()).build());
      • constructRequestFromLastPage

        protected String constructRequestFromLastPage​(String responsePage)
        Generates the code to construct a request object from the last successful page by setting the fields required to get the next page. Sample code: if responsePage string is "response" firstRequest.toBuilder().exclusiveStartTableName(response.lastEvaluatedTableName()).build()
      • fluentGetterMethodForResponseMember

        protected String fluentGetterMethodForResponseMember​(String member)
        Returns the fluent getter method for a single member in the response. The returned String includes the '()' after each method name. The input member can be a nested String. An example would be StreamDescription.LastEvaluatedShardId which represents LastEvaluatedShardId member in StreamDescription class. The return value for it would be "streamDescription().lastEvaluatedShardId()"
        Parameters:
        member - A top level or nested member in response of c2jOperationName.
      • getIteratorLambdaBlock

        protected com.squareup.javapoet.CodeBlock getIteratorLambdaBlock​(String resultKey,
                                                                         MemberModel resultKeyModel)