Skip to content

Package: JobStepPropertyImpl

JobStepPropertyImpl

nameinstructionbranchcomplexitylinemethod
JobStepPropertyImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
JobStepPropertyImpl(JobStepProperty)
M: 43 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 12 C: 0
0%
M: 1 C: 0
0%
JobStepPropertyImpl(String, String, String, String)
M: 15 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
getExampleValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMaxLength()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMaxValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMinLength()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMinValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPropertyType()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPropertyValue()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getRequired()
M: 15 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSecret()
M: 9 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getValidationRegex()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
parse(JobStepProperty)
M: 15 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setExampleValue(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setMaxLength(Integer)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setMaxValue(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setMinLength(Integer)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setMinValue(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setName(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPropertyType(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPropertyValue(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setRequired(Boolean)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setSecret(Boolean)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setValidationRegex(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.job.step.definition.internal;
14:
15: import org.eclipse.kapua.commons.jpa.SecretAttributeConverter;
16: import org.eclipse.kapua.service.job.step.definition.JobStepProperty;
17:
18: import javax.persistence.Basic;
19: import javax.persistence.Column;
20: import javax.persistence.Convert;
21: import javax.persistence.Embeddable;
22:
23: @Embeddable
24: public class JobStepPropertyImpl implements JobStepProperty {
25:
26: @Basic
27: @Column(name = "name", nullable = false, updatable = false)
28: private String name;
29:
30: @Basic
31: @Column(name = "property_type", nullable = false, updatable = false)
32: private String propertyType;
33:
34: @Basic
35: @Column(name = "property_value", nullable = false, updatable = false)
36: @Convert(converter = SecretAttributeConverter.class)
37: private String propertyValue;
38:
39: @Basic
40: @Column(name = "required", nullable = true, updatable = true)
41: private Boolean required;
42:
43: @Basic
44: @Column(name = "secret", nullable = true, updatable = true)
45: private Boolean secret;
46:
47: @Basic
48: @Column(name = "example_value", nullable = true, updatable = true)
49: private String propertyExampleValue;
50:
51: @Basic
52: @Column(name = "min_length", nullable = true, updatable = true)
53: private Integer minLength;
54:
55: @Basic
56: @Column(name = "max_length", nullable = true, updatable = true)
57: private Integer maxLength;
58:
59: @Basic
60: @Column(name = "min_value", nullable = true, updatable = true)
61: private String minValue;
62:
63: @Basic
64: @Column(name = "max_value", nullable = true, updatable = true)
65: private String maxValue;
66:
67: @Basic
68: @Column(name = "validation_regex", nullable = true, updatable = true)
69: private String validationRegex;
70:
71: public JobStepPropertyImpl() {
72: }
73:
74: private JobStepPropertyImpl(JobStepProperty jobStepProperty) {
75: setName(jobStepProperty.getName());
76: setPropertyType(jobStepProperty.getPropertyType());
77: setPropertyValue(jobStepProperty.getPropertyValue());
78: setRequired(jobStepProperty.getRequired());
79: setSecret(jobStepProperty.getSecret());
80: setExampleValue(jobStepProperty.getExampleValue());
81: setMinLength(jobStepProperty.getMinLength());
82: setMaxLength(jobStepProperty.getMaxLength());
83: setMinValue(jobStepProperty.getMinValue());
84: setMaxValue(jobStepProperty.getMaxValue());
85: }
86:
87: public JobStepPropertyImpl(String name, String propertyType, String propertyValue, String propertyExampleValue) {
88: setName(name);
89: setPropertyType(propertyType);
90: setPropertyValue(propertyValue);
91: setExampleValue(propertyExampleValue);
92: }
93:
94: @Override
95: public String getName() {
96: return name;
97: }
98:
99: @Override
100: public void setName(String name) {
101: this.name = name;
102: }
103:
104: @Override
105: public String getPropertyType() {
106: return propertyType;
107: }
108:
109: @Override
110: public void setPropertyType(String propertyType) {
111: this.propertyType = propertyType;
112: }
113:
114: @Override
115: public String getPropertyValue() {
116: return propertyValue;
117: }
118:
119: @Override
120: public void setPropertyValue(String propertyValue) {
121: this.propertyValue = propertyValue;
122: }
123:
124: @Override
125: public Boolean getRequired() {
126:• return required != null ? required : (propertyValue == null);
127: }
128:
129: @Override
130: public void setRequired(Boolean required) {
131: this.required = required;
132: }
133:
134: @Override
135: public Boolean getSecret() {
136:• if (secret == null) {
137: secret = Boolean.FALSE;
138: }
139:
140: return secret;
141: }
142:
143: @Override
144: public void setSecret(Boolean secret) {
145: this.secret = secret;
146: }
147:
148: @Override
149: public String getExampleValue() {
150: return propertyExampleValue;
151: }
152:
153: @Override
154: public void setExampleValue(String exampleValue) {
155: this.propertyExampleValue = exampleValue;
156: }
157:
158: @Override
159: public Integer getMinLength() {
160: return minLength;
161: }
162:
163: @Override
164: public void setMinLength(Integer minLength) {
165: this.minLength = minLength;
166: }
167:
168: @Override
169: public Integer getMaxLength() {
170: return maxLength;
171: }
172:
173: @Override
174: public void setMaxLength(Integer maxLength) {
175: this.maxLength = maxLength;
176: }
177:
178: @Override
179: public String getMinValue() {
180: return minValue;
181: }
182:
183: @Override
184: public void setMinValue(String minValue) {
185: this.minValue = minValue;
186: }
187:
188: @Override
189: public String getMaxValue() {
190: return maxValue;
191: }
192:
193: @Override
194: public void setMaxValue(String maxValue) {
195: this.maxValue = maxValue;
196: }
197:
198: @Override
199: public String getValidationRegex() {
200: return validationRegex;
201: }
202:
203: @Override
204: public void setValidationRegex(String validationRegex) {
205: this.validationRegex = validationRegex;
206: }
207:
208: public static JobStepPropertyImpl parse(JobStepProperty jobStepProperty) {
209:• return jobStepProperty != null ? (jobStepProperty instanceof JobStepPropertyImpl ? (JobStepPropertyImpl) jobStepProperty : new JobStepPropertyImpl(jobStepProperty)) : null;
210: }
211: }