1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 package software.amazon.awssdk.core.document; 17 18 import java.util.List; 19 import java.util.Map; 20 import software.amazon.awssdk.annotations.SdkPublicApi; 21 import software.amazon.awssdk.core.SdkNumber; 22 23 /** 24 * Document visitor interface. 25 * 26 * @param <R> Return type of the visitor. 27 */ 28 @SdkPublicApi 29 public interface DocumentVisitor<R> { 30 31 /** 32 * Visits a Document Null. 33 * 34 * @return value of the visitor 35 */ visitNull()36 R visitNull(); 37 38 /** 39 * Visits a Boolean Document. 40 * 41 * @param document Document to visit, 42 * @return Return value of the visitor. 43 */ visitBoolean(Boolean document)44 R visitBoolean(Boolean document); 45 46 /** 47 * Visits a String Document. 48 * 49 * @param document Document to visit, 50 * @return Return value of the visitor. 51 */ visitString(String document)52 R visitString(String document); 53 54 /** 55 * Visits a Number Document. 56 * 57 * @param document Document to visit, 58 * @return Return value of the visitor. 59 */ visitNumber(SdkNumber document)60 R visitNumber(SdkNumber document); 61 62 /** 63 * Visits a Map Document. 64 * 65 * @param documentMap Document to visit, 66 * @return Return value of the visitor. 67 */ visitMap(Map<String, Document> documentMap)68 R visitMap(Map<String, Document> documentMap); 69 70 /** 71 * Visits a List Document. 72 * 73 * @param documentList Document to visit, 74 * @return Return value of the visitor. 75 */ visitList(List<Document> documentList)76 R visitList(List<Document> documentList); 77 } 78