mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Cast to operation type in dto convertion
This commit is contained in:
parent
245d3706a2
commit
0f7df72167
@ -18,20 +18,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.wso2.carbon.device.mgt.core.operation.mgt.dao.util;
|
package org.wso2.carbon.device.mgt.core.operation.mgt.dao.util;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.core.dto.operation.mgt.CommandOperation;
|
import org.wso2.carbon.device.mgt.core.dto.operation.mgt.*;
|
||||||
import org.wso2.carbon.device.mgt.core.dto.operation.mgt.Operation;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dto.operation.mgt.ProfileOperation;
|
|
||||||
|
|
||||||
public class OperationDAOUtil {
|
public class OperationDAOUtil {
|
||||||
|
|
||||||
public static Operation convertOperation(org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation){
|
public static Operation convertOperation(org.wso2.carbon.device.mgt.common.operation.mgt.Operation operation) {
|
||||||
|
|
||||||
Operation dtoOperation = null;
|
Operation dtoOperation = null;
|
||||||
|
|
||||||
if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.COMMAND)){
|
if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.COMMAND)) {
|
||||||
dtoOperation = new CommandOperation();
|
dtoOperation = new CommandOperation();
|
||||||
}else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.PROFILE)){
|
} else if (operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.PROFILE)) {
|
||||||
dtoOperation = new ProfileOperation();
|
dtoOperation = new ProfileOperation();
|
||||||
|
}else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.POLICY)){
|
||||||
|
dtoOperation = new PolicyOperation();
|
||||||
|
}else if(operation.getType().equals(org.wso2.carbon.device.mgt.common.operation.mgt.Operation.Type.CONFIG)) {
|
||||||
|
dtoOperation = new ConfigOperation();
|
||||||
}else{
|
}else{
|
||||||
dtoOperation = new Operation();
|
dtoOperation = new Operation();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user