diff options
Diffstat (limited to 'dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java')
-rw-r--r-- | dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java index 576643f..647349f 100644 --- a/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java +++ b/dcaedt_catalog/asdc/src/main/java/org/onap/sdc/dcae/enums/AssetType.java @@ -1,5 +1,32 @@ package org.onap.sdc.dcae.enums; public enum AssetType { - RESOURCE, SERVICE + + RESOURCE(SdcContextPath.RESOURCES), + SERVICE(SdcContextPath.SERVICES), + VFCMT(SdcContextPath.RESOURCES), + VF(SdcContextPath.RESOURCES); + + private String sdcContextPath; + + AssetType(SdcContextPath sdcContextPath) { + this.sdcContextPath = sdcContextPath.name().toLowerCase(); + } + + public String getSdcContextPath() { + return sdcContextPath; + } + + // passing an invalid type will result in an IllegalArgumentException, which is fine as the 'type' value is an SDC enum value passed from SDC pluggable UI + public static AssetType getAssetTypeByName(String type) { + return AssetType.valueOf(type.toUpperCase()); + } + + public static String getSdcContextPath(String type) { + return getAssetTypeByName(type).getSdcContextPath(); + } + + private enum SdcContextPath { + RESOURCES, SERVICES + } } |