Skip to content

Commit

Permalink
Remove unnecessary public (#176)
Browse files Browse the repository at this point in the history
Client channel is an implementation detail of the client, and the method where
the channel classes are used is private. There is no need for these classes to
be public.
  • Loading branch information
vickenty committed Dec 23, 2021
1 parent 3678da9 commit 0328873
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/timgroup/statsd/ClientChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import java.nio.channels.WritableByteChannel;

public interface ClientChannel extends WritableByteChannel {
interface ClientChannel extends WritableByteChannel {
String getTransportType();
}
6 changes: 3 additions & 3 deletions src/main/java/com/timgroup/statsd/DatagramClientChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.nio.ByteBuffer;
import java.nio.channels.DatagramChannel;

public class DatagramClientChannel implements ClientChannel {
class DatagramClientChannel implements ClientChannel {
protected final DatagramChannel delegate;
private final SocketAddress address;

Expand All @@ -14,7 +14,7 @@ public class DatagramClientChannel implements ClientChannel {
* @param address Address to connect the channel to
* @throws IOException if an I/O error occurs
*/
public DatagramClientChannel(SocketAddress address) throws IOException {
DatagramClientChannel(SocketAddress address) throws IOException {
this(DatagramChannel.open(), address);
}

Expand All @@ -23,7 +23,7 @@ public DatagramClientChannel(SocketAddress address) throws IOException {
* @param delegate Implementation this instance wraps
* @param address Address to connect the channel to
*/
public DatagramClientChannel(DatagramChannel delegate, SocketAddress address) {
DatagramClientChannel(DatagramChannel delegate, SocketAddress address) {
this.delegate = delegate;
this.address = address;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/timgroup/statsd/NamedPipeClientChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

public class NamedPipeClientChannel implements ClientChannel {
class NamedPipeClientChannel implements ClientChannel {
private final RandomAccessFile randomAccessFile;
private final FileChannel fileChannel;
private final String pipe;
Expand All @@ -17,7 +17,7 @@ public class NamedPipeClientChannel implements ClientChannel {
* @param address Location of named pipe
* @throws FileNotFoundException if pipe does not exist
*/
public NamedPipeClientChannel(NamedPipeSocketAddress address) throws FileNotFoundException {
NamedPipeClientChannel(NamedPipeSocketAddress address) throws FileNotFoundException {
pipe = address.getPipe();
randomAccessFile = new RandomAccessFile(pipe, "rw");
fileChannel = randomAccessFile.getChannel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.io.IOException;
import java.net.SocketAddress;

public class UnixDatagramClientChannel extends DatagramClientChannel {
class UnixDatagramClientChannel extends DatagramClientChannel {
/**
* Creates a new UnixDatagramClientChannel.
*
Expand All @@ -15,7 +15,7 @@ public class UnixDatagramClientChannel extends DatagramClientChannel {
* @param bufferSize Buffer size
* @throws IOException if socket options cannot be set
*/
public UnixDatagramClientChannel(SocketAddress address, int timeout, int bufferSize) throws IOException {
UnixDatagramClientChannel(SocketAddress address, int timeout, int bufferSize) throws IOException {
super(UnixDatagramChannel.open(), address);
// Set send timeout, to handle the case where the transmission buffer is full
// If no timeout is set, the send becomes blocking
Expand Down

0 comments on commit 0328873

Please sign in to comment.