Skip to content

Commit 5250bf3

Browse files
authored
Merge pull request #407 from okue/code-refactoring
NON-ISSUE Code refactoring
2 parents 2d24382 + e7dbdf5 commit 5250bf3

File tree

6 files changed

+12
-36
lines changed

6 files changed

+12
-36
lines changed

line-bot-api-client/src/main/java/com/linecorp/bot/client/LineMessagingClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ public interface LineMessagingClient {
187187
* @see <a href="https://developers.line.me/en/reference/messaging-api/#get-group-member-user-ids">//developers.line.me/en/reference/messaging-api/#get-group-member-user-ids</a>
188188
* @see MembersIdsResponse#getNext()
189189
*/
190-
CompletableFuture<MembersIdsResponse> getGroupMembersIds(
191-
String groupId, String start);
190+
CompletableFuture<MembersIdsResponse> getGroupMembersIds(String groupId, String start);
192191

193192
/**
194193
* Get (a part of) room member list.
@@ -198,8 +197,7 @@ CompletableFuture<MembersIdsResponse> getGroupMembersIds(
198197
* @see <a href="https://developers.line.me/en/reference/messaging-api/#get-room-member-user-ids">//developers.line.me/en/reference/messaging-api/#get-room-member-user-ids</a>
199198
* @see MembersIdsResponse#getNext()
200199
*/
201-
CompletableFuture<MembersIdsResponse> getRoomMembersIds(
202-
String roomId, String start);
200+
CompletableFuture<MembersIdsResponse> getRoomMembersIds(String roomId, String start);
203201

204202
/**
205203
* Leave a group.

line-bot-api-client/src/main/java/com/linecorp/bot/client/LineMessagingClientBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class LineMessagingClientBuilder {
135135
* @see #channelTokenSupplier(ChannelTokenSupplier)
136136
*/
137137
public LineMessagingClientBuilder channelToken(String channelToken) {
138-
this.channelTokenSupplier(FixedChannelTokenSupplier.of(channelToken));
138+
channelTokenSupplier(FixedChannelTokenSupplier.of(channelToken));
139139
return this;
140140
}
141141

@@ -151,7 +151,7 @@ public LineMessagingClientBuilder channelToken(String channelToken) {
151151
* You should insert authentication headers yourself.
152152
*/
153153
public LineMessagingClientBuilder okHttpClientBuilder(
154-
@NonNull final OkHttpClient.Builder okHttpClientBuilder,
154+
final @NonNull OkHttpClient.Builder okHttpClientBuilder,
155155
final boolean addAuthenticationHeader) {
156156
this.okHttpClientBuilder = okHttpClientBuilder;
157157
this.addAuthenticationHeader = addAuthenticationHeader;

line-bot-spring-boot/src/main/java/com/linecorp/bot/spring/boot/LineBotProperties.java

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,53 +41,39 @@ public class LineBotProperties {
4141
*
4242
* @see ChannelTokenSupplyMode
4343
*/
44-
@NotNull
45-
private ChannelTokenSupplyMode channelTokenSupplyMode = ChannelTokenSupplyMode.FIXED;
44+
private @NotNull ChannelTokenSupplyMode channelTokenSupplyMode = ChannelTokenSupplyMode.FIXED;
4645

4746
/**
4847
* Channel acccess token.
4948
*/
50-
@Valid
51-
private String channelToken;
49+
private @Valid String channelToken;
5250

5351
/**
5452
* Channel secret.
5553
*/
56-
@Valid
57-
@NotNull
58-
private String channelSecret;
54+
private @Valid @NotNull String channelSecret;
5955

60-
@Valid
61-
@NotNull
62-
private String apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
56+
private @Valid @NotNull String apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
6357

6458
/**
6559
* Connection timeout in milliseconds.
6660
*/
67-
@Valid
68-
@NotNull
69-
private long connectTimeout = LineClientConstants.DEFAULT_CONNECT_TIMEOUT_MILLIS;
61+
private @Valid @NotNull long connectTimeout = LineClientConstants.DEFAULT_CONNECT_TIMEOUT_MILLIS;
7062

7163
/**
7264
* Read timeout in milliseconds.
7365
*/
74-
@Valid
75-
@NotNull
76-
private long readTimeout = LineClientConstants.DEFAULT_READ_TIMEOUT_MILLIS;
66+
private @Valid @NotNull long readTimeout = LineClientConstants.DEFAULT_READ_TIMEOUT_MILLIS;
7767

7868
/**
7969
* Write timeout in milliseconds.
8070
*/
81-
@Valid
82-
@NotNull
83-
private long writeTimeout = LineClientConstants.DEFAULT_WRITE_TIMEOUT_MILLIS;
71+
private @Valid @NotNull long writeTimeout = LineClientConstants.DEFAULT_WRITE_TIMEOUT_MILLIS;
8472

8573
/**
8674
* Configuration for {@link LineMessageHandler} and {@link EventMapping}.
8775
*/
88-
@Valid
89-
@NotNull
90-
private Handler handler = new Handler();
76+
private @Valid @NotNull Handler handler = new Handler();
9177

9278
@Data
9379
public static class Handler {

line-bot-spring-boot/src/main/java/com/linecorp/bot/spring/boot/annotation/EventMapping.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@
2121
import java.lang.annotation.RetentionPolicy;
2222
import java.lang.annotation.Target;
2323

24-
import com.google.common.annotations.Beta;
25-
2624
/**
2725
* Indicates that an annotated method is a LINE Messaging Event Handler.
2826
*
2927
* <p>Note: Only {@link EventMapping @EventMapping} annotated method
3028
* in the class annotated by {@link LineMessageHandler @LineMessageHandler} is enabled.
3129
*/
32-
@Beta
3330
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
3431
@Retention(RetentionPolicy.RUNTIME)
3532
public @interface EventMapping {

line-bot-spring-boot/src/main/java/com/linecorp/bot/spring/boot/annotation/LineMessageHandler.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@
2323

2424
import org.springframework.stereotype.Component;
2525

26-
import com.google.common.annotations.Beta;
27-
2826
/**
2927
* Indicates that an annotated class has a LINE Messaging Event Handler method.
3028
*
3129
* <p>This annotation serves as a specialization of {@link Component @Component},
3230
* allowing for implementation classes to be autodetected through classpath scanning.
3331
*/
34-
@Beta
3532
@Target(ElementType.TYPE)
3633
@Component
3734
@Retention(RetentionPolicy.RUNTIME)

line-bot-spring-boot/src/main/java/com/linecorp/bot/spring/boot/support/LineMessageHandlerSupport.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.springframework.web.bind.annotation.PostMapping;
3939
import org.springframework.web.bind.annotation.RestController;
4040

41-
import com.google.common.annotations.Beta;
4241
import com.google.common.annotations.VisibleForTesting;
4342
import com.google.common.base.Preconditions;
4443

@@ -70,7 +69,6 @@
7069
* </ul>
7170
*/
7271
@Slf4j
73-
@Beta
7472
@RestController
7573
@Import(ReplyByReturnValueConsumer.Factory.class)
7674
@ConditionalOnProperty(name = "line.bot.handler.enabled", havingValue = "true", matchIfMissing = true)

0 commit comments

Comments
 (0)