package com.k13n.lt_codes.broadcast;

import java.util.ArrayList;
import java.util.List;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterException;

class CliArguments {
  @Parameter(names = { "-p", "--port" }, description = "Port used to open socket")
  public Integer port = BroadcastSender.DEFAULT_PORT;

  @Parameter(names = { "-a", "--address" }, description = "IP broadcast address")
  public String ipAddress = BroadcastSender.DEFAULT_BROADCAST_ADDRESS;

  @Parameter(names = { "-h", "--help" }, help = true)
  private Boolean help = false;

  @Parameter(description = "Filename")
  public List<String> filenames = new ArrayList<>();

  public Integer getPort() {
    return port;
  }

  public String getBroadcastIpAddress() {
    return ipAddress;
  }

  public String getFilename() {
    if (filenames.isEmpty())
      throw new ParameterException("Main parameters cannot be left blank");
    return filenames.get(0);
  }

  public boolean hasFilename() {
    return !filenames.isEmpty();
  }

  public Boolean getHelp() {
    return help;
  }

}
@@ -274,29 +274,30 @@
 socket%22)%0A  p
-ublic
+rivate
  Integer por
@@ -412,29 +412,30 @@
 ddress%22)%0A  p
-ublic
+rivate
  String ipAd
@@ -615,21 +615,22 @@
 me%22)%0A  p
-ublic
+rivate
  List%3CSt

Change modifies from public to private in CliArguments