@Test public void testOnStringBecauseWhyNot() { SubscribeCommand subNotif = new SubscribeCommand( SubscribeCommand.Type.SUBSCRIBE_NOTIFICATION, serviceUUID, characteristicUUID, commandObserver); SubscribeCommand subIndi = new SubscribeCommand( SubscribeCommand.Type.SUBSCRIBE_INDICATION, serviceUUID, characteristicUUID, commandObserver); SubscribeCommand unsub = new SubscribeCommand( SubscribeCommand.Type.UNSUBSCRIBE, serviceUUID, characteristicUUID, commandObserver); assertNotNull(subNotif.toString()); assertNotNull(subIndi.toString()); assertNotNull(unsub.toString()); }
@Override public String toString() { if (type == Type.UNSUBSCRIBE) { return "UnsubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_INDICATION) { return "SubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_NOTIFICATION) { return "SubscribeNotificationCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else { return super.toString(); } }
SubscribeCommand extends SingleCharacteristicsCommand { @Override public String toString() { if (type == Type.UNSUBSCRIBE) { return "UnsubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_INDICATION) { return "SubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_NOTIFICATION) { return "SubscribeNotificationCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else { return super.toString(); } } }
SubscribeCommand extends SingleCharacteristicsCommand { @Override public String toString() { if (type == Type.UNSUBSCRIBE) { return "UnsubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_INDICATION) { return "SubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_NOTIFICATION) { return "SubscribeNotificationCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else { return super.toString(); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); }
SubscribeCommand extends SingleCharacteristicsCommand { @Override public String toString() { if (type == Type.UNSUBSCRIBE) { return "UnsubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_INDICATION) { return "SubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_NOTIFICATION) { return "SubscribeNotificationCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else { return super.toString(); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); @Override String toString(); }
SubscribeCommand extends SingleCharacteristicsCommand { @Override public String toString() { if (type == Type.UNSUBSCRIBE) { return "UnsubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_INDICATION) { return "SubscribeCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else if (type == Type.SUBSCRIBE_NOTIFICATION) { return "SubscribeNotificationCommand[" + characteristicUUID + "] on [" + serviceUUID + "]"; } else { return super.toString(); } } SubscribeCommand(@Type int type, UUID serviceUUID, UUID characteristicUUID, CommandObserver observer); @Override String toString();  }