Got rid of deprecated naming.

This commit is contained in:
Florian Nücke
2020-12-29 18:45:10 +01:00
parent aa59e47fc1
commit 090c2f2be6
2 changed files with 12 additions and 12 deletions

View File

@@ -10,17 +10,17 @@ import java.util.Objects;
import java.util.stream.Collectors;
public final class RPCDeviceList implements RPCDevice {
private final ArrayList<RPCDevice> deviceInterfaces;
private final ArrayList<RPCDevice> devices;
///////////////////////////////////////////////////////////////////
public RPCDeviceList(final ArrayList<RPCDevice> deviceInterfaces) {
this.deviceInterfaces = deviceInterfaces;
public RPCDeviceList(final ArrayList<RPCDevice> devices) {
this.devices = devices;
}
@Override
public List<String> getTypeNames() {
return deviceInterfaces.stream()
return devices.stream()
.map(RPCDevice::getTypeNames)
.flatMap(Collection::stream)
.collect(Collectors.toList());
@@ -28,7 +28,7 @@ public final class RPCDeviceList implements RPCDevice {
@Override
public List<RPCMethod> getMethods() {
return deviceInterfaces.stream()
return devices.stream()
.map(RPCDevice::getMethods)
.flatMap(Collection::stream)
.collect(Collectors.toList());
@@ -39,11 +39,11 @@ public final class RPCDeviceList implements RPCDevice {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final RPCDeviceList that = (RPCDeviceList) o;
return deviceInterfaces.equals(that.deviceInterfaces);
return devices.equals(that.devices);
}
@Override
public int hashCode() {
return Objects.hash(deviceInterfaces);
return Objects.hash(devices);
}
}

View File

@@ -41,7 +41,7 @@ public class RPCAdapterTests {
@Test
public void resetAndReadDescriptor() {
final VoidIntMethod method = new VoidIntMethod();
final TestRPCDeviceInterface device = new TestRPCDeviceInterface(method);
final TestRPCDevice device = new TestRPCDevice(method);
setDevice(device, DEVICE_UUID);
final JsonObject request = new JsonObject();
@@ -66,7 +66,7 @@ public class RPCAdapterTests {
@Test
public void simpleMethod() {
final VoidIntMethod method = new VoidIntMethod();
final TestRPCDeviceInterface device = new TestRPCDeviceInterface(method);
final TestRPCDevice device = new TestRPCDevice(method);
setDevice(device, DEVICE_UUID);
invokeMethod(DEVICE_UUID, method.getName(), 0xdeadbeef);
@@ -77,7 +77,7 @@ public class RPCAdapterTests {
@Test
public void returningMethod() {
final IntLongMethod method = new IntLongMethod();
final TestRPCDeviceInterface device = new TestRPCDeviceInterface(method);
final TestRPCDevice device = new TestRPCDevice(method);
setDevice(device, DEVICE_UUID);
final JsonElement result = invokeMethod(DEVICE_UUID, method.getName(), 0xdeadbeefcafebabeL);
@@ -220,10 +220,10 @@ public class RPCAdapterTests {
}
}
private static final class TestRPCDeviceInterface implements RPCDevice {
private static final class TestRPCDevice implements RPCDevice {
private final RPCMethod method;
public TestRPCDeviceInterface(final RPCMethod method) {
public TestRPCDevice(final RPCMethod method) {
this.method = method;
}