content: /*
   * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *     http://aws.amazon.com/apache2.0/
   *
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   */
  
  package com.amazon.aace.addressbook.config;
  
  import com.amazon.aace.core.config.EngineConfiguration;
  
  /**
   * The @c AddressBookConfiguration class programmatically generates the "aace.addressBook"
   * @c com.amazon.aace.core.config.EngineConfiguration used to configure the Address Book module.
   */
  public class AddressBookConfiguration {
      /**
       * Factory method used to programmatically generate "aace.addressBook" configuration data.
       * The data generated by this method is equivalent to providing the following JSON
       * values in a configuration file:
       *
       * @code{.json}
       * {
       *   "aace.addressBook" : {
       *      "cleanAllAddressBooksAtStart" : <true/false>
       *   }
       * }
       * @endcode
       *
       * @param [in] cleanAllAddressBooksAtStart indicates whether to clean all address books at start. The default value
       *         is @c true.
       */
      public static EngineConfiguration createAddressBookConfig(final boolean cleanAllAddressBooksAtStart) {
          return new EngineConfiguration() {
              @Override
              protected long createNativeRef() {
                  return createAddressBookConfigBinder(cleanAllAddressBooksAtStart);
              }
          };
      }
  
      public static EngineConfiguration createAddressBookConfig() {
          return createAddressBookConfig(true);
      }
  
      private static native long createAddressBookConfigBinder(boolean cleanAllAddressBooksAtStart);
  };
  