-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathInputOptions.java.html
More file actions
149 lines (131 loc) · 6.18 KB
/
Copy pathInputOptions.java.html
File metadata and controls
149 lines (131 loc) · 6.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang=""><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>InputOptions.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub Copilot SDK :: Java</a> > <a href="index.source.html" class="el_package">com.github.copilot.rpc</a> > <span class="el_source">InputOptions.java</span></div><h1>InputOptions.java</h1><pre class="source lang-java linenums">/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------------------------------------------*/
package com.github.copilot.rpc;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.OptionalInt;
/**
* Options for the {@link SessionUiApi#input(String, InputOptions)} convenience
* method.
*
* @since 1.0.0
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
<span class="fc" id="L19">public class InputOptions {</span>
private String title;
private String description;
@JsonProperty("minLength")
private Integer minLength;
@JsonProperty("maxLength")
private Integer maxLength;
private String format;
private String defaultValue;
/** Gets the title label for the input field. @return the title */
public String getTitle() {
<span class="fc" id="L32"> return title;</span>
}
/**
* Sets the title label for the input field. @param title the title @return this
*/
public InputOptions setTitle(String title) {
<span class="fc" id="L39"> this.title = title;</span>
<span class="fc" id="L40"> return this;</span>
}
/** Gets the descriptive text shown below the field. @return the description */
public String getDescription() {
<span class="fc" id="L45"> return description;</span>
}
/**
* Sets the descriptive text shown below the field. @param description the
* description @return this
*/
public InputOptions setDescription(String description) {
<span class="fc" id="L53"> this.description = description;</span>
<span class="fc" id="L54"> return this;</span>
}
/**
* Gets the minimum character length.
*
* @return an {@link java.util.OptionalInt} containing the min length, or
* {@link java.util.OptionalInt#empty()} if not set
*/
@JsonIgnore
public OptionalInt getMinLength() {
<span class="fc bfc" id="L65" title="All 2 branches covered."> return minLength == null ? OptionalInt.empty() : OptionalInt.of(minLength);</span>
}
/**
* Sets the minimum character length. @param minLength the min length @return
* this
*/
public InputOptions setMinLength(int minLength) {
<span class="fc" id="L73"> this.minLength = minLength;</span>
<span class="fc" id="L74"> return this;</span>
}
/**
* Clears the minLength setting, reverting to the default behavior.
*
* @return this instance for method chaining
*/
public InputOptions clearMinLength() {
<span class="fc" id="L83"> this.minLength = null;</span>
<span class="fc" id="L84"> return this;</span>
}
/**
* Gets the maximum character length.
*
* @return an {@link java.util.OptionalInt} containing the max length, or
* {@link java.util.OptionalInt#empty()} if not set
*/
@JsonIgnore
public OptionalInt getMaxLength() {
<span class="fc bfc" id="L95" title="All 2 branches covered."> return maxLength == null ? OptionalInt.empty() : OptionalInt.of(maxLength);</span>
}
/**
* Sets the maximum character length. @param maxLength the max length @return
* this
*/
public InputOptions setMaxLength(int maxLength) {
<span class="fc" id="L103"> this.maxLength = maxLength;</span>
<span class="fc" id="L104"> return this;</span>
}
/**
* Clears the maxLength setting, reverting to the default behavior.
*
* @return this instance for method chaining
*/
public InputOptions clearMaxLength() {
<span class="fc" id="L113"> this.maxLength = null;</span>
<span class="fc" id="L114"> return this;</span>
}
/**
* Gets the semantic format hint (e.g., {@code "email"}, {@code "uri"},
* {@code "date"}, {@code "date-time"}).
*
* @return the format hint
*/
public String getFormat() {
<span class="fc" id="L124"> return format;</span>
}
/** Sets the semantic format hint. @param format the format @return this */
public InputOptions setFormat(String format) {
<span class="fc" id="L129"> this.format = format;</span>
<span class="fc" id="L130"> return this;</span>
}
/**
* Gets the default value pre-populated in the field. @return the default value
*/
public String getDefaultValue() {
<span class="fc" id="L137"> return defaultValue;</span>
}
/**
* Sets the default value pre-populated in the field. @param defaultValue the
* default value @return this
*/
public InputOptions setDefaultValue(String defaultValue) {
<span class="fc" id="L145"> this.defaultValue = defaultValue;</span>
<span class="fc" id="L146"> return this;</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.14.202510111229</span></div></body></html>