Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2020 Robert Bosch GmbH |
| 3 | * Author: Constantin Ziesche (constantin.ziesche@bosch.com) |
| 4 | * |
| 5 | * This program and the accompanying materials are made available under the |
| 6 | * terms of the Eclipse Public License 2.0 which is available at |
| 7 | * http://www.eclipse.org/legal/epl-2.0 |
| 8 | * |
| 9 | * SPDX-License-Identifier: EPL-2.0 |
| 10 | *******************************************************************************/ |
| 11 | using System.Runtime.Serialization; |
| 12 | |
| 13 | namespace BaSyx.Models.Core.AssetAdministrationShell.References |
| 14 | { |
Constantin Ziesche | 310d2aa | 2020-03-25 11:48:26 +0100 | [diff] [blame] | 15 | /// <summary> |
| 16 | /// A key is a reference to an element by its id. |
| 17 | /// </summary> |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 18 | public interface IKey |
| 19 | { |
Constantin Ziesche | 310d2aa | 2020-03-25 11:48:26 +0100 | [diff] [blame] | 20 | /// <summary> |
| 21 | /// Denote which kind of entity is referenced. In case type = GlobalReference then the element is a global unique id. |
| 22 | /// In all other cases the key references a model element of the same or of another AAS.The name of the model element is explicitly listed. |
| 23 | /// </summary> |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 24 | [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "type")] |
| 25 | KeyElements Type { get; } |
Constantin Ziesche | 310d2aa | 2020-03-25 11:48:26 +0100 | [diff] [blame] | 26 | |
| 27 | /// <summary> |
| 28 | /// Type of the key value.In case of idType = idShort local shall be true. |
| 29 | /// In case type=GlobalReference idType shall not be IdShort. |
| 30 | /// </summary> |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 31 | [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "idType")] |
| 32 | KeyType IdType { get; } |
Constantin Ziesche | 310d2aa | 2020-03-25 11:48:26 +0100 | [diff] [blame] | 33 | |
| 34 | /// <summary> |
| 35 | /// The key value, for example an IRDI if the idType=IRDI. |
| 36 | /// </summary> |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 37 | [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "value")] |
| 38 | string Value { get; } |
Constantin Ziesche | 310d2aa | 2020-03-25 11:48:26 +0100 | [diff] [blame] | 39 | |
| 40 | /// <summary> |
| 41 | /// Denotes if the key references a model element of the same AAS (=true) or not (=false). |
| 42 | /// In case of local = false the key may reference a model element of another AAS or an entity outside any AAS that has a global unique id. |
| 43 | /// </summary> |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 44 | [DataMember(EmitDefaultValue = false, IsRequired = false, Name = "local")] |
| 45 | bool Local { get; } |
Constantin Ziesche | 02817f1 | 2020-08-04 21:40:43 +0200 | [diff] [blame^] | 46 | |
| 47 | /// <summary> |
| 48 | /// Returns the official string representation of a Key according to Details of Asset Administration Shell (Chapter 5.2.1) |
| 49 | /// </summary> |
| 50 | /// <returns></returns> |
| 51 | string ToStandardizedString(); |
Constantin Ziesche | 857c7ab | 2020-02-25 11:24:51 +0100 | [diff] [blame] | 52 | } |
| 53 | } |