1 /*
2 * Copyright (C) 2011 Atlassian
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
17 package com.atlassian.jira.rest.client.domain.input;
18
19 import com.atlassian.jira.rest.client.domain.Comment;
20
21 import javax.annotation.Nullable;
22
23 /**
24 * Input parameters used for issue link creation.
25 */
26 public class LinkIssuesInput {
27 private final String fromIssueKey;
28 private final String toIssueKey;
29 private final String linkType;
30 private final Comment comment;
31
32 /**
33 * @param fromIssueKey source issue key
34 * @param toIssueKey destination issue key
35 * @param linkType name of the link type (e.g. "Duplicate")
36 * @param comment optional comment
37 */
38 public LinkIssuesInput(String fromIssueKey, String toIssueKey, String linkType, @Nullable Comment comment) {
39 this.fromIssueKey = fromIssueKey;
40 this.toIssueKey = toIssueKey;
41 this.comment = comment;
42 this.linkType = linkType;
43 }
44
45 public LinkIssuesInput(String fromIssueKey, String toIssueKey, String linkType) {
46 this(fromIssueKey, toIssueKey, linkType, null);
47 }
48
49
50 /**
51 * @return source issue key
52 */
53 public String getFromIssueKey() {
54 return fromIssueKey;
55 }
56
57 /**
58 * @return destination issue key
59 */
60 public String getToIssueKey() {
61 return toIssueKey;
62 }
63
64 /**
65 * @return optional comment or <code>null</code>
66 */
67 @Nullable
68 public Comment getComment() {
69 return comment;
70 }
71
72 /**
73 * @return name of the link type (e.g. "Duplicate")
74 */
75 public String getLinkType() {
76 return linkType;
77 }
78 }