View Javadoc

1   /*
2    * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH
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  package de.smartics.properties.tutorial.property.list;
17  
18  import java.net.URL;
19  import java.util.List;
20  
21  import javax.validation.constraints.NotNull;
22  
23  import de.smartics.properties.api.core.annotations.PropertyElementType;
24  import de.smartics.properties.api.core.annotations.PropertyKeyName;
25  import de.smartics.properties.api.core.annotations.PropertySet;
26  
27  /**
28   * List constants to use for tests.
29   */
30  @PropertySet("tutorial.property.list")
31  public interface ListProperties
32  {
33    /**
34     * A simple list of Strings. Note that per default the elements are expected
35     * to be of type {@link String}.
36     */
37    @PropertyKeyName("list-of-strings")
38    @NotNull
39    List<String> listOfStrings();
40  
41    /**
42     * A simple list of Integers. Note that the {@link PropertyElementType} is
43     * needed to specify the element types.
44     */
45    @PropertyKeyName("list-of-ints")
46    @PropertyElementType(Integer.class)
47    @NotNull
48    List<Integer> listOfInts();
49  
50    /**
51     * Separating by pipes.
52     */
53    @PropertyKeyName("piped-list-of-strings")
54    @NotNull
55    List<String> pipedListOfStrings();
56  
57    /**
58     * Separating by blanks.
59     */
60    @PropertyKeyName("blanked-list-of-strings")
61    @NotNull
62    List<String> blankedListOfStrings();
63  
64    /**
65     * An example that shows how to specify strings with blanks an non alpha
66     * numeric characters.
67     */
68    @PropertyKeyName("extreme-list-of-strings")
69    @NotNull
70    List<String> extremeListOfStrings();
71  
72    /**
73     * A simple list of URLs that shows the conversion with a complex type like an
74     * URL.
75     */
76    @PropertyKeyName("list-of-urls")
77    @PropertyElementType(URL.class)
78    @NotNull
79    List<URL> listOfUrls();
80  
81    /**
82     * An example that shows that the separator is optional.
83     */
84    @PropertyKeyName("newline-urls")
85    @PropertyElementType(URL.class)
86    @NotNull
87    List<URL> listOfNewLineUrls();
88  
89    /**
90     * A simple list of enum elements.
91     */
92    @PropertyKeyName("priority-list")
93    @PropertyElementType(Priority.class)
94    @NotNull
95    List<Priority> listOfPriorities();
96  }