Skip to content

Commit 423c4eb

Browse files
committed
Version 5.2.2
1 parent d3d23e7 commit 423c4eb

File tree

10 files changed

+170
-103
lines changed

10 files changed

+170
-103
lines changed

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jar{
3030
dependencies{
3131
api group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.7.2'
3232
api group: 'org.json', name: 'json', version: '20200518'
33-
api group: 'org.jetbrains', name: 'annotations', version: '19.0.0'
34-
api(group: 'net.dv8tion', name: 'JDA', version: '4.2.0_171'){
33+
api(group: 'net.dv8tion', name: 'JDA', version: '4.2.0_172'){
3534
exclude(module: 'opus-java')
3635
}
3736
api group: 'com.github.ben-manes.caffeine', name: 'caffeine', version: '2.8.0'

src/main/java/org/botblock/javabotblockapi/BotBlockAPI.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
package org.botblock.javabotblockapi;
1919

2020
import org.botblock.javabotblockapi.annotations.DeprecatedSince;
21+
import org.botblock.javabotblockapi.annotations.PlannedRemoval;
2122
import org.botblock.javabotblockapi.requests.CheckUtil;
2223
import org.botblock.javabotblockapi.requests.PostAction;
23-
import org.jetbrains.annotations.NotNull;
2424

25+
import javax.annotation.Nonnull;
2526
import java.util.HashMap;
2627
import java.util.Map;
2728

@@ -52,11 +53,12 @@ public class BotBlockAPI{
5253
*/
5354
@Deprecated
5455
@DeprecatedSince(version = "5.2.0")
55-
public BotBlockAPI(@NotNull Map<String, String> tokens){
56+
@PlannedRemoval(version = "5.2.3")
57+
public BotBlockAPI(@Nonnull Map<String, String> tokens){
5658
this(tokens, DEFAULT_DELAY);
5759
}
5860

59-
private BotBlockAPI(@NotNull Map<String, String> tokens, int updateDelay){
61+
private BotBlockAPI(@Nonnull Map<String, String> tokens, int updateDelay){
6062
if(tokens.isEmpty())
6163
throw new NullPointerException("Tokens may not be empty.");
6264

@@ -104,7 +106,7 @@ public Builder(){}
104106
*
105107
* @since 2.1.0
106108
*/
107-
public Builder addAuthToken(@NotNull Site site, @NotNull String token){
109+
public Builder addAuthToken(@Nonnull Site site, @Nonnull String token){
108110
CheckUtil.notEmpty(token, "Token");
109111

110112
tokens.put(site.getSite(), token);
@@ -128,7 +130,7 @@ public Builder addAuthToken(@NotNull Site site, @NotNull String token){
128130
*
129131
* @return The Builder after the site and token were set. Useful for chaining.
130132
*/
131-
public Builder addAuthToken(@NotNull String site, @NotNull String token){
133+
public Builder addAuthToken(@Nonnull String site, @Nonnull String token){
132134
CheckUtil.notEmpty(site, "Site");
133135
CheckUtil.notEmpty(token, "Token");
134136

@@ -149,7 +151,7 @@ public Builder addAuthToken(@NotNull String site, @NotNull String token){
149151
*
150152
* @return The Builder after the Map was set. Useful for chaining.
151153
*/
152-
public Builder setAuthTokens(@NotNull Map<String, String> tokens){
154+
public Builder setAuthTokens(@Nonnull Map<String, String> tokens){
153155
CheckUtil.notEmpty(tokens, "Tokens");
154156

155157
this.tokens = tokens;
@@ -169,7 +171,7 @@ public Builder setAuthTokens(@NotNull Map<String, String> tokens){
169171
*
170172
* @return The Builder after the updateInterval was set. Useful for chaining.
171173
*/
172-
public Builder setUpdateDelay(@NotNull Integer updateDelay){
174+
public Builder setUpdateDelay(@Nonnull Integer updateDelay){
173175
CheckUtil.condition(updateDelay < 2, "UpdateDelay may not be less than 2.");
174176

175177
this.updateDelay = updateDelay;

src/main/java/org/botblock/javabotblockapi/annotations/DeprecatedSince.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
import java.lang.annotation.*;
2222

2323
/**
24-
* Annotation used to indicate since when a method or field is deprecated.
25-
* <br>This is paired with the {@link java.lang.Deprecated @Deprecated} annotation.
24+
* Annotation used to indicate since when an Object is deprecated.
25+
* <br>This is always paired with the {@link java.lang.Deprecated @Deprecated} annotation.
2626
*
27-
* <p>Methods or fields annotated with this should be avoided as it may or may not be removed in a future release.
28-
* <br>A possible replacement method or field will be indicated when possible.
27+
* <p>A replacement may be mentioned with the {@link #replacements() replacements String array} but is not guaranteed.
28+
* <br>Anything annotated with this should be avoided as it may be removed in a future release.
2929
*
3030
* @since 3.2.0
3131
*/
@@ -38,7 +38,7 @@
3838
* Since what version this method or field is deprecated.
3939
* <br>This is field is required!
4040
*
41-
* @return The version since when this method/field is deprecated.
41+
* @return The version since when this object is deprecated.
4242
*/
4343
String version();
4444

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2019 - 2020 Andre601
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
6+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7+
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial
10+
* portions of the Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13+
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
14+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
15+
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
16+
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
*/
18+
19+
package org.botblock.javabotblockapi.annotations;
20+
21+
import java.lang.annotation.*;
22+
23+
/**
24+
* Annotation to mark an Object to be planned for removal.
25+
* <br>This is often paired with the {@link java.lang.Deprecated Deprecated} and {@link org.botblock.javabotblockapi.annotations.DeprecatedSince DeprecatedSince}
26+
* annotations.
27+
*
28+
* <p>This annotation will always contain {@link #version() the version} in which the annotated Object will be removed.
29+
*
30+
* @since 5.2.2
31+
*/
32+
@Documented
33+
@Retention(RetentionPolicy.RUNTIME)
34+
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE, ElementType.CONSTRUCTOR})
35+
public @interface PlannedRemoval{
36+
37+
/**
38+
* The version for when the annotated object will be removed.
39+
*
40+
* @return The version for when this Object will be removed.
41+
*/
42+
String version();
43+
}

src/main/java/org/botblock/javabotblockapi/annotations/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
*/
1818

1919
/**
20-
* Contains annotations used within the project for various things.
20+
* The different annotations used to mark various Objects with it.
2121
*/
2222
package org.botblock.javabotblockapi.annotations;

0 commit comments

Comments
 (0)