Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
HudsonJobConfig |
|
|
1.0;1 |
1 | /* |
|
2 | * Copyright 2012 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.ci.config.load; |
|
17 | ||
18 | import de.smartics.util.lang.Arguments; |
|
19 | import de.smartics.util.lang.BlankArgumentException; |
|
20 | ||
21 | /** |
|
22 | * Provides information about a Hudson job configuration file ( |
|
23 | * <code>config.xml</code>. |
|
24 | */ |
|
25 | public final class HudsonJobConfig |
|
26 | { |
|
27 | // ********************************* Fields ********************************* |
|
28 | ||
29 | // --- constants ------------------------------------------------------------ |
|
30 | ||
31 | // --- members -------------------------------------------------------------- |
|
32 | ||
33 | /** |
|
34 | * The identifier of the job configuration. |
|
35 | */ |
|
36 | private final String id; |
|
37 | ||
38 | /** |
|
39 | * The Hudson job configuration file as an XML string. |
|
40 | */ |
|
41 | private final String configXml; |
|
42 | ||
43 | // ****************************** Initializer ******************************* |
|
44 | ||
45 | // ****************************** Constructors ****************************** |
|
46 | ||
47 | /** |
|
48 | * Default constructor. |
|
49 | * |
|
50 | * @param id the identifier of the job configuration. |
|
51 | * @param configXml the Hudson job configuration file as an XML string. |
|
52 | * @throws BlankArgumentException if either {@code id} or {@code configXml} is |
|
53 | * blank. |
|
54 | */ |
|
55 | public HudsonJobConfig(final String id, final String configXml) |
|
56 | throws BlankArgumentException |
|
57 | 0 | { |
58 | 0 | Arguments.checkNotBlank("id", id); |
59 | 0 | Arguments.checkNotBlank("configXml", configXml); |
60 | ||
61 | 0 | this.id = id; |
62 | 0 | this.configXml = configXml; |
63 | 0 | } |
64 | ||
65 | // ****************************** Inner Classes ***************************** |
|
66 | ||
67 | // ********************************* Methods ******************************** |
|
68 | ||
69 | // --- init ----------------------------------------------------------------- |
|
70 | ||
71 | // --- get&set -------------------------------------------------------------- |
|
72 | ||
73 | /** |
|
74 | * Returns the identifier of the job configuration. |
|
75 | * |
|
76 | * @return the identifier of the job configuration. |
|
77 | */ |
|
78 | public String getId() |
|
79 | { |
|
80 | 0 | return id; |
81 | } |
|
82 | ||
83 | /** |
|
84 | * Returns the Hudson job configuration file as an XML string. |
|
85 | * |
|
86 | * @return the Hudson job configuration file as an XML string. |
|
87 | */ |
|
88 | public String getConfigXml() |
|
89 | { |
|
90 | 0 | return configXml; |
91 | } |
|
92 | ||
93 | // --- business ------------------------------------------------------------- |
|
94 | ||
95 | // --- object basics -------------------------------------------------------- |
|
96 | ||
97 | } |