@Test public void testParametersAreImmutable() { Set<String> parameterSet = new HashSet<>(); final AntennaComplianceToolOptions antennaComplianceToolOptions = new AntennaComplianceToolOptions(PROPERTIES_PATH, AntennaComplianceToolOptions.MODE_NAME_REPORTER, parameterSet, false, false, true); Set<String> parametersFromOptions = antennaComplianceToolOptions.getParameters(); parametersFromOptions.add("--parameter=x"); assertThat(parametersFromOptions).isNotEqualTo(antennaComplianceToolOptions.getParameters()); assertThat(antennaComplianceToolOptions.getParameters()).isEqualTo(parameterSet); }
Set<String> getParameters() { return parameters == null ? Collections.emptySet() : new HashSet<>(parameters); }
AntennaComplianceToolOptions extends AbstractAntennaCLIOptions { Set<String> getParameters() { return parameters == null ? Collections.emptySet() : new HashSet<>(parameters); } }
AntennaComplianceToolOptions extends AbstractAntennaCLIOptions { Set<String> getParameters() { return parameters == null ? Collections.emptySet() : new HashSet<>(parameters); } AntennaComplianceToolOptions(String propertiesFilePath, String complianceMode, Set<String> parameters, boolean debugLog, boolean showHelp, boolean valid); }
AntennaComplianceToolOptions extends AbstractAntennaCLIOptions { Set<String> getParameters() { return parameters == null ? Collections.emptySet() : new HashSet<>(parameters); } AntennaComplianceToolOptions(String propertiesFilePath, String complianceMode, Set<String> parameters, boolean debugLog, boolean showHelp, boolean valid); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
AntennaComplianceToolOptions extends AbstractAntennaCLIOptions { Set<String> getParameters() { return parameters == null ? Collections.emptySet() : new HashSet<>(parameters); } AntennaComplianceToolOptions(String propertiesFilePath, String complianceMode, Set<String> parameters, boolean debugLog, boolean showHelp, boolean valid); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String SWITCH_REPORTER; }