/* * Copyright (c) 2018 iTAC Software AG, Germany. All Rights Reserved. * * This software is protected by copyright. Under no circumstances may any part of this file in any form be copied, * printed, edited or otherwise distributed, be stored in a retrieval system, or be translated into another language * without the written permission of iTAC Software AG. */ // created 31.10.2018 08:16:46 using System; using System.Collections.Generic; namespace com.itac.oib.monitoring.contracts.data { // source: assembly 5.1.0.84 // source: assembly ASM.AS.OIB.Monitoring.Proxy public class DownloadRecipeMapper:MonitoringDataMapper { // used for itac->asm: True // used for asm->itac: True // maps iTAC namespace conform type to ASM namespace type public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe get(DownloadRecipe asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe itacDownloadRecipe = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe(); mapItac2Asm(itacDownloadRecipe, asmDownloadRecipe); return itacDownloadRecipe; } public static void mapItac2Asm(Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe itacDownloadRecipe, DownloadRecipe asmDownloadRecipe) { // property Recipe is readonly(no set method) // property DownloadTime is readonly(no set method) } // maps iTAC namespace conform array to ASM namespace array public static Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe[] get(DownloadRecipe[] asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe[] itacDownloadRecipe = new Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe[asmDownloadRecipe.Length]; for (int i = 0; i < asmDownloadRecipe.Length; i++) { // to itac array itacDownloadRecipe[i] = DownloadRecipeMapper.get(asmDownloadRecipe[i]); } return itacDownloadRecipe; } // maps iTAC namespace conform array to ASM namespace list public static List getList(DownloadRecipe[] asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } List itacDownloadRecipe = new List(); for (int i = 0; i < asmDownloadRecipe.Length; i++) { itacDownloadRecipe.Add(DownloadRecipeMapper.get(asmDownloadRecipe[i])); } return itacDownloadRecipe; } // map type from ASM namespace to iTAC namespace public static DownloadRecipe get(Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } DownloadRecipe itacDownloadRecipe = new DownloadRecipe(); mapAsm2Itac(asmDownloadRecipe, itacDownloadRecipe); return itacDownloadRecipe; } public static void mapAsm2Itac(Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe asmDownloadRecipe, DownloadRecipe itacDownloadRecipe) { MonitoringDataMapper.mapAsm2Itac(asmDownloadRecipe, itacDownloadRecipe); itacDownloadRecipe.Recipe = com.itac.oib.monitoring.contracts.data.RecipeMapper.get(asmDownloadRecipe.Recipe); // complex asm property Recipe itacDownloadRecipe.DownloadTime = asmDownloadRecipe.DownloadTime; } // maps ASM namespace conform list to iTAC namespace array public static DownloadRecipe[] getArray(IList asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } DownloadRecipe[] itacDownloadRecipe = new DownloadRecipe[asmDownloadRecipe.Count]; for (int i = 0; i < asmDownloadRecipe.Count; i++) { itacDownloadRecipe[i] = DownloadRecipeMapper.get(asmDownloadRecipe[i]); } return itacDownloadRecipe; } // maps ASM namespace conform array to iTAC namespace array public static DownloadRecipe[] getArray(Asm.As.Oib.Monitoring.Proxy.Business.Objects.DownloadRecipe[] asmDownloadRecipe) { if (asmDownloadRecipe == null) { return null; } DownloadRecipe[] itacDownloadRecipe = new DownloadRecipe[asmDownloadRecipe.Length]; for (int i = 0; i < asmDownloadRecipe.Length; i++) { itacDownloadRecipe[i] = DownloadRecipeMapper.get(asmDownloadRecipe[i]); } return itacDownloadRecipe; } } }