Skip to content

Package: JobStepDefinitionFactoryImpl

JobStepDefinitionFactoryImpl

nameinstructionbranchcomplexitylinemethod
JobStepDefinitionFactoryImpl()
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%
clone(JobStepDefinition)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
newCreator(KapuaId)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newEntity(KapuaId)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newListResult()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newQuery(KapuaId)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newStepProperty(String, String, String)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
newStepProperty(String, String, String, String)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 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.KapuaEntityCloneException;
16: import org.eclipse.kapua.locator.KapuaProvider;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.job.step.definition.JobStepDefinition;
19: import org.eclipse.kapua.service.job.step.definition.JobStepDefinitionCreator;
20: import org.eclipse.kapua.service.job.step.definition.JobStepDefinitionFactory;
21: import org.eclipse.kapua.service.job.step.definition.JobStepDefinitionListResult;
22: import org.eclipse.kapua.service.job.step.definition.JobStepDefinitionQuery;
23: import org.eclipse.kapua.service.job.step.definition.JobStepProperty;
24:
25: /**
26: * {@link JobStepDefinitionFactory} implementation.
27: *
28: * @since 1.0.0
29: */
30: @KapuaProvider
31: public class JobStepDefinitionFactoryImpl implements JobStepDefinitionFactory {
32:
33: @Override
34: public JobStepDefinition newEntity(KapuaId scopeId) {
35: return new JobStepDefinitionImpl(scopeId);
36: }
37:
38: @Override
39: public JobStepDefinitionCreator newCreator(KapuaId scopeId) {
40: return new JobStepDefinitionCreatorImpl(scopeId);
41: }
42:
43: @Override
44: public JobStepDefinitionQuery newQuery(KapuaId scopeId) {
45: return new JobStepDefinitionQueryImpl(scopeId);
46: }
47:
48: @Override
49: public JobStepDefinitionListResult newListResult() {
50: return new JobStepDefinitionListResultImpl();
51: }
52:
53: @Override
54: public JobStepProperty newStepProperty(String name, String type, String value) {
55: return new JobStepPropertyImpl(name, type, value, null);
56: }
57:
58: @Override
59: public JobStepProperty newStepProperty(String name, String type, String value, String exampleValue) {
60: return new JobStepPropertyImpl(name, type, value, exampleValue);
61: }
62:
63: @Override
64: public JobStepDefinition clone(JobStepDefinition jobStepDefinition) {
65: try {
66: return new JobStepDefinitionImpl(jobStepDefinition);
67: } catch (Exception e) {
68: throw new KapuaEntityCloneException(e, JobStepDefinition.TYPE, jobStepDefinition);
69: }
70: }
71: }