]>
Commit | Line | Data |
---|---|---|
d14ebb43 | 1 | /** @file\r |
2 | UsageIdentification class.\r | |
3 | \r | |
4 | This class an identification for a PCD UsageInstance.\r | |
5 | \r | |
6 | Copyright (c) 2006, Intel Corporation\r | |
7 | All rights reserved. This program and the accompanying materials\r | |
8 | are licensed and made available under the terms and conditions of the BSD License\r | |
9 | which accompanies this distribution. The full text of the license may be found at\r | |
10 | http://opensource.org/licenses/bsd-license.php\r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
14 | \r | |
15 | **/ \r | |
16 | \r | |
17 | package org.tianocore.pcd.entity;\r | |
18 | \r | |
19 | /**\r | |
bc262841 | 20 | The identification for a UsageInstance. \r |
21 | It should be extend from ModuleIdentification in future.\r | |
22 | \r | |
d14ebb43 | 23 | **/\r |
24 | public class UsageIdentification {\r | |
25 | ///\r | |
26 | /// The module CName: one key of Identification\r | |
27 | /// \r | |
28 | public String moduleName;\r | |
bc262841 | 29 | \r |
d14ebb43 | 30 | /// \r |
31 | /// The module Guid String: one key of Identification\r | |
32 | /// \r | |
33 | public String moduleGuid;\r | |
bc262841 | 34 | \r |
d14ebb43 | 35 | /// \r |
36 | /// The package CName: one key of Identification \r | |
37 | ///\r | |
38 | public String packageName;\r | |
bc262841 | 39 | \r |
d14ebb43 | 40 | /// \r |
41 | /// The package Guid: one key of Identification\r | |
42 | /// \r | |
43 | public String packageGuid;\r | |
bc262841 | 44 | \r |
d14ebb43 | 45 | /// \r |
46 | /// Module's Arch: one key of Identification\r | |
47 | /// \r | |
48 | public String arch;\r | |
bc262841 | 49 | \r |
d14ebb43 | 50 | /// \r |
51 | /// Module's version: one key of Identification\r | |
52 | /// \r | |
53 | public String version;\r | |
bc262841 | 54 | \r |
d14ebb43 | 55 | ///\r |
56 | /// Module's type\r | |
57 | /// \r | |
58 | public String moduleType;\r | |
59 | \r | |
60 | /**\r | |
61 | Constructor function for UsageIdentification class.\r | |
62 | \r | |
63 | @param moduleName The key of module's name\r | |
64 | @param moduleGuid The key of module's GUID string\r | |
65 | @param packageName The key of package's name\r | |
66 | @param packageGuid The key of package's Guid\r | |
67 | @param arch The architecture string\r | |
68 | @param version The version String\r | |
69 | @param moduleType The module type\r | |
70 | **/\r | |
71 | public UsageIdentification (String moduleName,\r | |
72 | String moduleGuid,\r | |
73 | String packageName,\r | |
74 | String packageGuid,\r | |
75 | String arch,\r | |
76 | String version,\r | |
77 | String moduleType) {\r | |
78 | this.moduleName = moduleName;\r | |
79 | this.moduleGuid = moduleGuid;\r | |
80 | this.packageName = packageName;\r | |
81 | this.packageGuid = packageGuid;\r | |
82 | this.arch = arch;\r | |
83 | this.version = version;\r | |
84 | this.moduleType = moduleType;\r | |
85 | }\r | |
86 | \r | |
87 | /**\r | |
88 | Generate the string for UsageIdentification\r | |
89 | \r | |
90 | @return the string value for UsageIdentification\r | |
91 | **/\r | |
92 | public String toString() {\r | |
93 | //\r | |
94 | // Because currently transition schema not require write moduleGuid, package Name, Packge GUID in\r | |
95 | // <ModuleSA> section, So currently no expect all paramter must be valid.\r | |
96 | // BUGBUG: Because currently we can not get version from MSA, So ignore verison.\r | |
97 | // \r | |
98 | return(moduleName + "_" +\r | |
99 | ((moduleGuid != null) ? moduleGuid.toLowerCase() : "NullModuleGuid") + "_" +\r | |
100 | ((packageName != null) ? packageName : "NullPackageName") + "_" +\r | |
101 | ((packageGuid != null) ? packageGuid.toLowerCase() : "NullPackageGuid") + "_" +\r | |
102 | ((arch != null) ? arch : "NullArch") + "_" +\r | |
103 | "NullVersion");\r | |
104 | }\r | |
105 | }\r |