public NetconfDeviceSimulator(final Configuration configuration) {
this.configuration = configuration;
- this.servers = new ArrayList<>(configuration.getDeviceCount());
- this.sshTransportStackFactory = new SSHTransportStackFactory("netconf-device-simulator-threads",
+ servers = new ArrayList<>(configuration.getDeviceCount());
+ sshTransportStackFactory = new SSHTransportStackFactory("netconf-device-simulator-threads",
configuration.getThreadPoolSize());
hashedWheelTimer = new HashedWheelTimer();
}
}
configuration.getDefaultYangResources().forEach(r -> {
- final SourceIdentifier sourceIdentifier = new SourceIdentifier(r.getModuleName(), r.getRevision());
- registerSource(consumer, r.getResourcePath(), sourceIdentifier);
+ registerSource(consumer, r.resourcePath(), new SourceIdentifier(r.moduleName(), r.revision()));
});
try {
*/
package org.opendaylight.netconf.test.tool.config;
-import java.util.Objects;
-
-public class YangResource {
-
- private final String moduleName;
- private final String revision;
- private final String resourcePath;
-
- public YangResource(String moduleName, String revision, String resourcePath) {
- this.moduleName = moduleName;
- this.revision = revision;
- this.resourcePath = resourcePath;
- }
-
- public String getModuleName() {
- return moduleName;
- }
-
- public String getRevision() {
- return revision;
- }
-
- public String getResourcePath() {
- return resourcePath;
- }
-
- @Override
- public boolean equals(Object object) {
- if (this == object) {
- return true;
- }
- if (object == null || getClass() != object.getClass()) {
- return false;
- }
- YangResource that = (YangResource) object;
- return Objects.equals(moduleName, that.moduleName)
- && Objects.equals(revision, that.revision)
- && Objects.equals(resourcePath, that.resourcePath);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(moduleName, revision, resourcePath);
- }
-
+public record YangResource(String moduleName, String revision, String resourcePath) {
+ // Nothing else
}