|
4 | 4 | import com.google.gson.annotations.SerializedName;
|
5 | 5 | import lombok.Getter;
|
6 | 6 |
|
| 7 | +/** Representation of a configuration property definition. */ |
7 | 8 | public class PackageMaterialProperty {
|
8 | 9 |
|
| 10 | + /** |
| 11 | + * The default value for {@code this} property. |
| 12 | + * |
| 13 | + * @return the default value for {@code this} property |
| 14 | + */ |
9 | 15 | @Expose @SerializedName("default-value")
|
10 | 16 | @Getter private String defaultValue;
|
11 | 17 |
|
| 18 | + /** |
| 19 | + * The value for {@code this} property. |
| 20 | + * |
| 21 | + * @return the value for {@code this} property |
| 22 | + */ |
12 | 23 | @Expose
|
13 | 24 | @Getter private String value;
|
14 | 25 |
|
| 26 | + /** |
| 27 | + * Flag indicating whether the content of {@code this} property value should be displayed hidden. |
| 28 | + * |
| 29 | + * @return {@code true} if value should be hidden, otherwise {@code false} |
| 30 | + */ |
15 | 31 | @Expose
|
16 | 32 | @Getter private Boolean secure;
|
17 | 33 |
|
| 34 | + /** |
| 35 | + * Flag indicating whether {@code this} property is part of the configuration identifier. |
| 36 | + * |
| 37 | + * @return {@code true} if {@code this} property is part of the identity, otherwise {@code false} |
| 38 | + */ |
18 | 39 | @Expose @SerializedName("part-of-identity")
|
19 | 40 | @Getter private Boolean partOfIdentity;
|
20 | 41 |
|
| 42 | + /** |
| 43 | + * FLag indicating whether a value for {@code this} property is required |
| 44 | + * |
| 45 | + * @return {@code true} if value is required, otherwise {@code false} |
| 46 | + */ |
21 | 47 | @Getter private Boolean required;
|
22 | 48 |
|
| 49 | + /** |
| 50 | + * The display name for {@code this} property. |
| 51 | + * |
| 52 | + * @return the display name for {@code this} property |
| 53 | + */ |
23 | 54 | @Expose @SerializedName("display-name")
|
24 | 55 | @Getter private String displayName;
|
25 | 56 |
|
| 57 | + /** |
| 58 | + * The display order for {@code this} property. |
| 59 | + * |
| 60 | + * @return the display order for {@code this} property |
| 61 | + */ |
26 | 62 | @Expose @SerializedName("display-order")
|
27 | 63 | @Getter private String displayOrder;
|
28 | 64 |
|
| 65 | + /** |
| 66 | + * Constructs a property. |
| 67 | + * <p /> |
| 68 | + * All {@code boolean} properties are set to {@code false} as default value. |
| 69 | + */ |
29 | 70 | public PackageMaterialProperty() {
|
30 | 71 | this.secure = false;
|
31 | 72 | this.partOfIdentity = false;
|
32 | 73 | this.required = false;
|
33 | 74 | }
|
34 | 75 |
|
| 76 | + /** |
| 77 | + * Sets whether value should be hidden. |
| 78 | + * <p /> |
| 79 | + * Default is {@code false}. |
| 80 | + * |
| 81 | + * @param secure {@code true} if value should be hidden, otherwise {@code false} |
| 82 | + * @return {@code this} property |
| 83 | + */ |
35 | 84 | public PackageMaterialProperty withSecure(final boolean secure) {
|
36 | 85 | this.secure = secure;
|
37 | 86 | return this;
|
38 | 87 | }
|
39 | 88 |
|
| 89 | + /** |
| 90 | + * Sets whether property is part of identity. |
| 91 | + * <p /> |
| 92 | + * Default is {@code false}. |
| 93 | + * |
| 94 | + * @param partOfIdentity {@code true} if {@code this} property is part of the identity, otherwise {@code false} |
| 95 | + * @return {@code this} property |
| 96 | + */ |
40 | 97 | public PackageMaterialProperty withPartOfIdentity(final boolean partOfIdentity) {
|
41 | 98 | this.partOfIdentity = partOfIdentity;
|
42 | 99 | return this;
|
43 | 100 | }
|
44 | 101 |
|
| 102 | + /** |
| 103 | + * Sets whether a value is required. |
| 104 | + * <p /> |
| 105 | + * Default is {@code false}. |
| 106 | + * |
| 107 | + * @param required {@code true} if value is required, otherwise {@code false} |
| 108 | + * @return {@code this} property |
| 109 | + */ |
45 | 110 | public PackageMaterialProperty withRequired(final boolean required) {
|
46 | 111 | this.required = required;
|
47 | 112 | return this;
|
48 | 113 | }
|
49 | 114 |
|
| 115 | + /** |
| 116 | + * Sets the display name. |
| 117 | + * |
| 118 | + * @param displayName the display name to set |
| 119 | + * @return {@code this} property |
| 120 | + */ |
50 | 121 | public PackageMaterialProperty withDisplayName(final String displayName) {
|
51 | 122 | this.displayName = displayName;
|
52 | 123 | return this;
|
53 | 124 | }
|
54 | 125 |
|
| 126 | + /** |
| 127 | + * Sets the display order. |
| 128 | + * |
| 129 | + * @param displayOrder the display order to set |
| 130 | + * @return {@code this} property |
| 131 | + */ |
55 | 132 | public PackageMaterialProperty withDisplayOrder(final int displayOrder) {
|
56 | 133 | this.displayOrder = Integer.toString(displayOrder);
|
57 | 134 | return this;
|
58 | 135 | }
|
59 | 136 |
|
| 137 | + /** |
| 138 | + * Sets the default value. |
| 139 | + * |
| 140 | + * @param defaultValue the default value to set |
| 141 | + * @return {@code this} property |
| 142 | + */ |
60 | 143 | public PackageMaterialProperty withDefaultValue(final String defaultValue) {
|
61 | 144 | this.defaultValue = defaultValue;
|
62 | 145 | return this;
|
63 | 146 | }
|
64 | 147 |
|
| 148 | + /** |
| 149 | + * Sets the value. |
| 150 | + * |
| 151 | + * @param value the value to set |
| 152 | + * @return {@code this} property |
| 153 | + */ |
65 | 154 | public PackageMaterialProperty withValue(final String value) {
|
66 | 155 | this.value = value;
|
67 | 156 | return this;
|
|
0 commit comments