@Test public void testBuildWhereValue() { final String VALUE = "XXX"; assertEquals(buildWhereValue(VALUE, Type.AMPLIFIER_GENERAL), VALUE); assertEquals(buildWhereValue(VALUE, Type.AMPLIFIER_P2P), VALUE); assertEquals(buildWhereValue(VALUE, Type.SOURCE_GENERAL), VALUE); assertEquals(buildWhereValue(VALUE, Type.SOURCE_P2P), VALUE); assertEquals(buildWhereValue(VALUE, Type.AMPLIFIER_GROUP), "#" + VALUE); }
protected static String buildWhereValue(String where, Type type) { switch (type) { case AMPLIFIER_GENERAL: case AMPLIFIER_P2P: case SOURCE_GENERAL: case SOURCE_P2P: return where; case AMPLIFIER_GROUP: return WHERE_GROUP_PREFIX.concat(where); } throw new IllegalArgumentException("invalid type"); }
SoundSystem extends BaseOpenMessage { protected static String buildWhereValue(String where, Type type) { switch (type) { case AMPLIFIER_GENERAL: case AMPLIFIER_P2P: case SOURCE_GENERAL: case SOURCE_P2P: return where; case AMPLIFIER_GROUP: return WHERE_GROUP_PREFIX.concat(where); } throw new IllegalArgumentException("invalid type"); } }
SoundSystem extends BaseOpenMessage { protected static String buildWhereValue(String where, Type type) { switch (type) { case AMPLIFIER_GENERAL: case AMPLIFIER_P2P: case SOURCE_GENERAL: case SOURCE_P2P: return where; case AMPLIFIER_GROUP: return WHERE_GROUP_PREFIX.concat(where); } throw new IllegalArgumentException("invalid type"); } protected  SoundSystem(String value); }
SoundSystem extends BaseOpenMessage { protected static String buildWhereValue(String where, Type type) { switch (type) { case AMPLIFIER_GENERAL: case AMPLIFIER_P2P: case SOURCE_GENERAL: case SOURCE_P2P: return where; case AMPLIFIER_GROUP: return WHERE_GROUP_PREFIX.concat(where); } throw new IllegalArgumentException("invalid type"); } protected  SoundSystem(String value); static SoundSystem requestTurnOn(String where, Type type, Source source); static SoundSystem requestTurnOff(String where, Type type, Source source); static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail); static SoundSystem requestStatus(String where, Type type); static Func1<OpenSession, OpenSession> handleStatus(Action0 onStatus, Action0 offStatus); static SoundSystem requestVolumeUp(String where, Type type); static SoundSystem requestVolumeDown(String where, Type type); static SoundSystem requestStationUp(String where, Type type); static SoundSystem requestStationDown(String where, Type type); }
SoundSystem extends BaseOpenMessage { protected static String buildWhereValue(String where, Type type) { switch (type) { case AMPLIFIER_GENERAL: case AMPLIFIER_P2P: case SOURCE_GENERAL: case SOURCE_P2P: return where; case AMPLIFIER_GROUP: return WHERE_GROUP_PREFIX.concat(where); } throw new IllegalArgumentException("invalid type"); } protected  SoundSystem(String value); static SoundSystem requestTurnOn(String where, Type type, Source source); static SoundSystem requestTurnOff(String where, Type type, Source source); static Func1<OpenSession, OpenSession> handleResponse(Action0 onSuccess, Action0 onFail); static SoundSystem requestStatus(String where, Type type); static Func1<OpenSession, OpenSession> handleStatus(Action0 onStatus, Action0 offStatus); static SoundSystem requestVolumeUp(String where, Type type); static SoundSystem requestVolumeDown(String where, Type type); static SoundSystem requestStationUp(String where, Type type); static SoundSystem requestStationDown(String where, Type type);  }