@Mapping(from = Permission.class, to = VdcObjectType.class) public static VdcObjectType map(Permission p, VdcObjectType template) { return p.isSetDataCenter() && p.getDataCenter().isSetId() ? VdcObjectType.StoragePool : p.isSetCluster() && p.getCluster().isSetId() ? VdcObjectType.Cluster : p.isSetHost() && p.getHost().isSetId() ? VdcObjectType.VDS : p.isSetStorageDomain() && p.getStorageDomain().isSetId() ? VdcObjectType.Storage : p.isSetVm() && p.getVm().isSetId() ? VdcObjectType.VM : p.isSetVmPool() && p.getVmPool().isSetId() ? VdcObjectType.VmPool : p.isSetTemplate() && p.getTemplate().isSetId() ? VdcObjectType.VmTemplate : template; }
@Mapping(from = Permission.class, to = Guid.class) public static Guid map(Permission p, Guid template) { return p.isSetDataCenter() && p.getDataCenter().isSetId() ? GuidUtils.asGuid(p.getDataCenter().getId()) : p.isSetCluster() && p.getCluster().isSetId() ? GuidUtils.asGuid(p.getCluster().getId()) : p.isSetHost() && p.getHost().isSetId() ? GuidUtils.asGuid(p.getHost().getId()) : p.isSetStorageDomain() && p.getStorageDomain().isSetId() ? GuidUtils.asGuid(p.getStorageDomain().getId()) : p.isSetVm() && p.getVm().isSetId() ? GuidUtils.asGuid(p.getVm().getId()) : p.isSetVmPool() && p.getVmPool().isSetId() ? GuidUtils.asGuid(p.getVmPool().getId()) : p.isSetTemplate() && p.getTemplate().isSetId() ? GuidUtils.asGuid(p.getTemplate().getId()) : template; }
to.setActions(adaptOut(from.getActions())); if (from.isSetCluster()) { to.setCluster(adaptOut(from.getCluster()));