View Javadoc
1   /*
2    * Copyright 2022-2026 the original author or authors.
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    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.bremersee.spring.boot.autoconfigure.data.mongo;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  import lombok.Data;
22  import org.springframework.boot.context.properties.ConfigurationProperties;
23  
24  /**
25   * The mongo properties.
26   *
27   * @author Christian Bremer
28   */
29  @ConfigurationProperties(prefix = "bremersee.data.mongo")
30  @Data
31  public class MongoProperties {
32  
33    /**
34     * The custom conversions properties.
35     */
36    private CustomConversionsProperties customConversions = new CustomConversionsProperties();
37  
38    /**
39     * Instantiates new mongo properties.
40     */
41    public MongoProperties() {
42      super();
43    }
44  
45    /**
46     * The custom conversions properties.
47     */
48    @Data
49    public static class CustomConversionsProperties {
50  
51      /**
52       * Specifies whether custom conversions should be created as primary bean or not. Default is
53       * {@code true}.
54       */
55      private boolean enable = true;
56  
57      /**
58       * Specifies whether the converters must be annotated with
59       * {@code org.springframework.data.convert.ReadingConverter} and
60       * {@code org.springframework.data.convert.WritingConverter}. Default is {@code true}.
61       */
62      private boolean readWriteAnnotationRequired = true;
63  
64      /**
65       * Regexes for class names.
66       */
67      private List<String> allowClassNames = new ArrayList<>();
68  
69      /**
70       * Instantiates new custom conversions properties.
71       */
72      public CustomConversionsProperties() {
73        super();
74      }
75    }
76  
77  }