Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit a8e1b8d

Browse files
committed
Add DateParameter, TimeParameter and DateTimeParameter
1 parent 8f48f54 commit a8e1b8d

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.codeoverflow.chatoverflow.api.io.parameter;
2+
3+
import org.codeoverflow.chatoverflow.api.IsRequirement;
4+
5+
import java.time.LocalDate;
6+
7+
/**
8+
* A {@link Parameter} that is a date
9+
*/
10+
@IsRequirement
11+
public interface DateParameter extends Parameter<LocalDate> {
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.codeoverflow.chatoverflow.api.io.parameter;
2+
3+
import org.codeoverflow.chatoverflow.api.IsRequirement;
4+
5+
import java.time.LocalDateTime;
6+
7+
/**
8+
* A {@link Parameter} that is a time at a specific date
9+
*/
10+
@IsRequirement
11+
public interface DateTimeParameter extends Parameter<LocalDateTime> {
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.codeoverflow.chatoverflow.api.io.parameter;
2+
3+
import org.codeoverflow.chatoverflow.api.IsRequirement;
4+
5+
import java.time.LocalTime;
6+
7+
/**
8+
* A {@link Parameter} that is a time
9+
*/
10+
@IsRequirement
11+
public interface TimeParameter extends Parameter<LocalTime> {
12+
}

src/main/java/org/codeoverflow/chatoverflow/api/plugin/configuration/Parameter.java

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
import org.codeoverflow.chatoverflow.api.io.parameter.BooleanParameter;
66
import org.codeoverflow.chatoverflow.api.io.parameter.ColorParameter;
7+
import org.codeoverflow.chatoverflow.api.io.parameter.DateParameter;
8+
import org.codeoverflow.chatoverflow.api.io.parameter.DateTimeParameter;
79
import org.codeoverflow.chatoverflow.api.io.parameter.DoubleParameter;
810
import org.codeoverflow.chatoverflow.api.io.parameter.IntegerParameter;
911
import org.codeoverflow.chatoverflow.api.io.parameter.ListParameter;
1012
import org.codeoverflow.chatoverflow.api.io.parameter.MapParameter;
1113
import org.codeoverflow.chatoverflow.api.io.parameter.StringParameter;
14+
import org.codeoverflow.chatoverflow.api.io.parameter.TimeParameter;
1215
import org.codeoverflow.chatoverflow.api.io.parameter.UriParameter;
1316

1417
// THIS FILE IS GENERATED WHILE COMPILING. DO NOT CHANGE ANYTHING HERE!
@@ -68,6 +71,50 @@ public Requirement<ColorParameter> colorParameter(String uniqueRequirementId) {
6871
return requirements.requireParameter(uniqueRequirementId, "Color Parameter", false, ColorParameter.class);
6972
}
7073

74+
/**
75+
* Requires a DateParameter which has to be specified by the user.
76+
*
77+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
78+
* @param displayName a string to display to the user while setting your requirement
79+
* @param isOptional true if this requirement is optional, false if mandatory
80+
* @return the requirement object. Use the get() method only at runtime!
81+
*/
82+
public Requirement<DateParameter> dateParameter(String uniqueRequirementId, String displayName, boolean isOptional) {
83+
return requirements.requireParameter(uniqueRequirementId, displayName, isOptional, DateParameter.class);
84+
}
85+
86+
/**
87+
* Requires a DateParameter which has to be specified by the user.
88+
*
89+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
90+
* @return the requirement object. Use the get() method only at runtime!
91+
*/
92+
public Requirement<DateParameter> dateParameter(String uniqueRequirementId) {
93+
return requirements.requireParameter(uniqueRequirementId, "Date Parameter", false, DateParameter.class);
94+
}
95+
96+
/**
97+
* Requires a DateTimeParameter which has to be specified by the user.
98+
*
99+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
100+
* @param displayName a string to display to the user while setting your requirement
101+
* @param isOptional true if this requirement is optional, false if mandatory
102+
* @return the requirement object. Use the get() method only at runtime!
103+
*/
104+
public Requirement<DateTimeParameter> dateTimeParameter(String uniqueRequirementId, String displayName, boolean isOptional) {
105+
return requirements.requireParameter(uniqueRequirementId, displayName, isOptional, DateTimeParameter.class);
106+
}
107+
108+
/**
109+
* Requires a DateTimeParameter which has to be specified by the user.
110+
*
111+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
112+
* @return the requirement object. Use the get() method only at runtime!
113+
*/
114+
public Requirement<DateTimeParameter> dateTimeParameter(String uniqueRequirementId) {
115+
return requirements.requireParameter(uniqueRequirementId, "Date Time Parameter", false, DateTimeParameter.class);
116+
}
117+
71118
/**
72119
* Requires a DoubleParameter which has to be specified by the user.
73120
*
@@ -178,6 +225,28 @@ public Requirement<StringParameter> stringParameter(String uniqueRequirementId)
178225
return requirements.requireParameter(uniqueRequirementId, "String Parameter", false, StringParameter.class);
179226
}
180227

228+
/**
229+
* Requires a TimeParameter which has to be specified by the user.
230+
*
231+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
232+
* @param displayName a string to display to the user while setting your requirement
233+
* @param isOptional true if this requirement is optional, false if mandatory
234+
* @return the requirement object. Use the get() method only at runtime!
235+
*/
236+
public Requirement<TimeParameter> timeParameter(String uniqueRequirementId, String displayName, boolean isOptional) {
237+
return requirements.requireParameter(uniqueRequirementId, displayName, isOptional, TimeParameter.class);
238+
}
239+
240+
/**
241+
* Requires a TimeParameter which has to be specified by the user.
242+
*
243+
* @param uniqueRequirementId a plugin unique identifier which is stored for your plugin
244+
* @return the requirement object. Use the get() method only at runtime!
245+
*/
246+
public Requirement<TimeParameter> timeParameter(String uniqueRequirementId) {
247+
return requirements.requireParameter(uniqueRequirementId, "Time Parameter", false, TimeParameter.class);
248+
}
249+
181250
/**
182251
* Requires a UriParameter which has to be specified by the user.
183252
*

0 commit comments

Comments
 (0)