public String setStatus(boolean turnOn) throws ComplianceException { boolean currentStatus = getStatus(); if (currentStatus == true && turnOn == false) { ComplianceSwitchController.complianceOff(); return null; } if (currentStatus == false && turnOn == true) { String complianceOn = ComplianceSwitchController.complianceOn(); return complianceOn; } return null; }
private boolean getStatus() { return ComplianceSwitchController.isOn(); }