Skip to content

Commit

Permalink
Remove deprecated methods/constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
mbax committed Dec 23, 2024
1 parent b15f931 commit 872c96f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 71 deletions.
37 changes: 5 additions & 32 deletions src/main/java/org/kitteh/irc/client/library/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public interface Client extends ClientLinked {
* Builds {@link Client}s. Create a builder with {@link Client#builder()}.
* <p>
* The default built client connects securely via port 6697. See {@link
* Server#secure(boolean)} to disable, or the other secure-prefixed methods in
* Server##port(int, Server.SecurityType)} to disable, or the other secure-prefixed methods in
* this builder to fully utilize the feature. Note that the default
* TrustManagerFactory relies on your local trust store. The default Oracle
* trust store does not accept self-signed certificates.
Expand Down Expand Up @@ -174,18 +174,6 @@ enum SecurityType {
*/
@NonNull Server host(@NonNull String host);

/**
* Sets the server port to which the client will connect.
* <p>
* By default, the port is 6697.
*
* @param port IRC server port
* @return this builder
* @deprecated use {@link #port(int, SecurityType)} instead
*/
@Deprecated
@NonNull Server port(int port);

/**
* Sets the server port to which the client will connect and
* determines TLS setting. By default, the port is 6697 and the
Expand All @@ -207,27 +195,12 @@ enum SecurityType {
*/
@NonNull Server password(@Nullable String password);

/**
* Sets whether the client connects via TLS.
* <p>
* Note that by default the TrustManager used does not accept the
* certificates of many popular networks. You must use {@link
* #secureTrustManagerFactory(TrustManagerFactory)} to set your own
* TrustManagerFactory.
*
* @param secure true for TLS
* @return this builder
* @deprecated use {@link #port(int, SecurityType)} instead
*/
@Deprecated
@NonNull Server secure(boolean secure);

/**
* Sets the key for TLS connection.
*
* @param keyCertChainFile X.509 certificate chain file in PEM format
* @return this builder
* @see #secure(boolean)
* @see #port(int, SecurityType)
*/
@NonNull Server secureKeyCertChain(@Nullable Path keyCertChainFile);

Expand All @@ -236,7 +209,7 @@ enum SecurityType {
*
* @param keyFile PKCS#8 private key file in PEM format
* @return this builder
* @see #secure(boolean)
* @see #port(int, SecurityType)
*/
@NonNull Server secureKey(@Nullable Path keyFile);

Expand All @@ -245,7 +218,7 @@ enum SecurityType {
*
* @param password password for private key
* @return this builder
* @see #secure(boolean)
* @see #port(int, SecurityType)
*/
@NonNull Server secureKeyPassword(@Nullable String password);

Expand All @@ -255,7 +228,7 @@ enum SecurityType {
* @param factory trust manager supplier
* @return this builder
* @throws IllegalArgumentException if providing an insecure factory while the STS storage manager is set
* @see #secure(boolean)
* @see #port(int, SecurityType)
*/
@NonNull Server secureTrustManagerFactory(@Nullable TrustManagerFactory factory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,6 @@ private class ServerImpl implements Server {
return this;
}

@Deprecated
@Override
public @NonNull Server port(int port) {
DefaultBuilder.this.serverHostWithPort = DefaultBuilder.this.serverHostWithPort.withPort(DefaultBuilder.this.isValidPort(port));
return this;
}

@Override
public @NonNull Server port(int port, @NonNull SecurityType security) {
DefaultBuilder.this.serverHostWithPort = DefaultBuilder.this.serverHostWithPort.withPort(DefaultBuilder.this.isValidPort(port));
Expand All @@ -120,13 +113,6 @@ private class ServerImpl implements Server {
return this;
}

@Deprecated
@Override
public @NonNull Server secure(boolean secure) {
DefaultBuilder.this.secure = secure;
return this;
}

@Override
public @NonNull Server secureKeyCertChain(@Nullable Path keyCertChainFile) {
DefaultBuilder.this.secureKeyCertChain = keyCertChainFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,6 @@ public ChannelTopicEvent(@NonNull Client client, @NonNull ServerMessage sourceMe
this.updated = updated;
}

/**
* Creates the event.
*
* @param client client for which this is occurring
* @param sourceMessage source message
* @param channel channel the topic is about
* @param updated if this is a new change
* @deprecated Use new constructor
*/
@Deprecated
public ChannelTopicEvent(@NonNull Client client, @NonNull ServerMessage sourceMessage, @NonNull Channel channel, boolean updated) {
this(client, sourceMessage, channel, null, null, updated);
}

/**
* Gets the channel's topic.
*
* @return the channel topic
* @deprecated Use {@link #getNewTopic()} and {@link #getOldTopic()}
*/
@Deprecated
public Channel.@NonNull Topic getTopic() {
return this.getChannel().getTopic();
}

public Channel.@NonNull Topic getNewTopic() {
return this.newTopic;
}
Expand Down

0 comments on commit 872c96f

Please sign in to comment.