Skip to content

Commit

Permalink
Add nullable annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 13, 2024
1 parent 1dc95d8 commit ff8015f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public interface Session {
* @param compressionConfig the compression to compress with,
* or null to disable compression
*/
void setCompression(CompressionConfig compressionConfig);
void setCompression(@Nullable CompressionConfig compressionConfig);

/**
* Sets encryption for this session.
Expand All @@ -198,7 +198,7 @@ public interface Session {
* or null to disable encryption
*
*/
void setEncryption(EncryptionConfig encryptionConfig);
void setEncryption(@Nullable EncryptionConfig encryptionConfig);

/**
* Returns true if the session is connected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void callPacketSent(Packet packet) {
}

@Override
public void setCompression(CompressionConfig compressionConfig) {
public void setCompression(@Nullable CompressionConfig compressionConfig) {
if (this.channel == null) {
throw new IllegalStateException("You need to connect to set the compression!");
}
Expand All @@ -196,9 +196,9 @@ public void setCompression(CompressionConfig compressionConfig) {
}

@Override
public void setEncryption(EncryptionConfig encryptionConfig) {
public void setEncryption(@Nullable EncryptionConfig encryptionConfig) {
if (channel == null) {
throw new IllegalStateException("You need to connect to enable encryption!");
throw new IllegalStateException("You need to connect to set the encryption!");
}

channel.attr(NetworkConstants.ENCRYPTION_ATTRIBUTE_KEY).set(encryptionConfig);
Expand Down

0 comments on commit ff8015f

Please sign in to comment.