package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum AssetTypeEnum {
RESOURCES("resources", "Resource"), SERVICES("services", "Service"), PRODUCTS("products", "Product");
- private String value;
-
- public String getValue() {
- return value;
- }
-
- public String getCorrespondingComponent() {
- return correspondingComponent;
- }
-
- private String correspondingComponent;
-
- AssetTypeEnum(String value, String correspondingComponent) {
- this.value = value;
- this.correspondingComponent = correspondingComponent;
- }
+ private final String value;
+ private final String correspondingComponent;
public static ComponentTypeEnum convertToComponentTypeEnum(String assetType) {
ComponentTypeEnum ret = null;
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum ComponentTypeEnum {
RESOURCE("Resource"),
SERVICE("Service"),
PRODUCT("Product"),
SERVICE_INSTANCE("Service Instance");
- private String value;
-
- ComponentTypeEnum(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
-
// Those values cannot be another field in enum, because they are needed
// as constants for Swagger allowedValues param
public static final String RESOURCE_PARAM_NAME = "resources";
public static final String SERVICE_PARAM_NAME = "services";
public static final String PRODUCT_PARAM_NAME = "products";
-
- public NodeTypeEnum getNodeType() {
-
- switch (this) {
- case RESOURCE:
- return NodeTypeEnum.Resource;
- case SERVICE:
- return NodeTypeEnum.Service;
- case PRODUCT:
- return NodeTypeEnum.Product;
- case RESOURCE_INSTANCE:
- return NodeTypeEnum.ResourceInstance;
- default:
- throw new UnsupportedOperationException("No nodeType is defined for: " + this.getValue());
- }
- }
+ private final String value;
public static ComponentTypeEnum findByValue(String value) {
ComponentTypeEnum ret = null;
}
return ret;
}
+
+ public NodeTypeEnum getNodeType() {
+
+ switch (this) {
+ case RESOURCE:
+ return NodeTypeEnum.Resource;
+ case SERVICE:
+ return NodeTypeEnum.Service;
+ case PRODUCT:
+ return NodeTypeEnum.Product;
+ case RESOURCE_INSTANCE:
+ return NodeTypeEnum.ResourceInstance;
+ default:
+ throw new UnsupportedOperationException("No nodeType is defined for: " + this.getValue());
+ }
+ }
}
import java.util.Arrays;
import java.util.List;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+@Getter
+@AllArgsConstructor
public enum ConnectionPointEnum {
CAPABILITY("capability"), REQUIREMENT("requirement");
- private String data;
private static List<ConnectionPointEnum> connectionPointEnums = Arrays.asList(values());
+ private final String data;
- ConnectionPointEnum(String inData) {
- this.data = inData;
+ public static ConnectionPointEnum getConnectionPointEnum(String data) {
+ return connectionPointEnums.stream().filter(cp -> cp.toString().equals(data)).findAny().orElse(null);
}
@Override
public String toString() {
return data;
}
-
- public static ConnectionPointEnum getConnectionPointEnum(String data) {
- return connectionPointEnums.stream().filter(cp -> cp.toString().equals(data)).findAny().orElse(null);
- }
}
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.Getter;
+
+@Getter
public enum CreatedFrom {
UI,
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.Getter;
+
+@Getter
public enum DeclarationTypeEnum {
INPUT,
OUTPUT,
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum EnvironmentStatusEnum {
UNKNOWN("unknown"),
IN_PROGRESS("in_progress"),
private final String name;
- EnvironmentStatusEnum(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
public static EnvironmentStatusEnum getByName(final String name) {
switch (name) {
case ("in_progress"):
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
/**
- * Category Type Enum
- * Any service category to be supported by SDC Ext API can be added here
+ * Category Type Enum Any service category to be supported by SDC Ext API can be added here
*
* @author atifhusain
*/
+@Getter
+@AllArgsConstructor
public enum ExternalCategoryTypeEnum {
PARTNER_DOMAIN_SERVICE("Partner Domain Service", true);
- private String value;
- private boolean isAtomicType;
-
- ExternalCategoryTypeEnum(String value, boolean isAtomicType) {
- this.value = value;
- this.isAtomicType = isAtomicType;
- }
-
- public String getValue() {
- return value;
- }
-
- public boolean isAtomicType() {
- return isAtomicType;
- }
+ private final String value;
+ private final boolean isAtomicType;
public static ExternalCategoryTypeEnum getType(String type) {
for (ExternalCategoryTypeEnum e : ExternalCategoryTypeEnum.values()) {
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+@Getter
+@AllArgsConstructor
public enum FilterKeyEnum {
- RESOURCE_TYPE("resourceType"), SUB_CATEGORY("subCategory"), CATEGORY("category"), DISTRIBUTION_STATUS("distributionStatus"), NAME_FRAGMENT("nameFragment");
+ RESOURCE_TYPE("resourceType"), SUB_CATEGORY("subCategory"), CATEGORY("category"), DISTRIBUTION_STATUS("distributionStatus"), NAME_FRAGMENT(
+ "nameFragment");
private static final int NUMBER_OF_RESOURCES_FILTERED = 3;
private static final int NUMBER_OF_SERVICES_FILTERED = 4;
- private String name;
-
- FilterKeyEnum(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
+ private final String name;
public static List<String> getAllFilters() {
return Arrays.stream(FilterKeyEnum.values()).map(FilterKeyEnum::getName).collect(Collectors.toList());
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum GroupTypeEnum {
VF_MODULE("org.openecomp.groups.VfModule"), HEAT_STACK("org.openecomp.groups.HeatStack");
- private String groupTypeName;
-
- GroupTypeEnum(String groupTypeName) {
- this.groupTypeName = groupTypeName;
- }
+ private final String groupTypeName;
- public String getGroupTypeName() {
- return groupTypeName;
- }
}
package org.openecomp.sdc.be.datatypes.enums;
import java.util.stream.Stream;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+@Getter
+@AllArgsConstructor
public enum InstantiationTypes {
A_LA_CARTE("A-la-carte"),
MACRO("Macro");
- private String value;
-
- InstantiationTypes(String value) {
- this.value = value;
- }
-
- public String getValue() {
- return value;
- }
+ private final String value;
/**
* Checks if enum with the given type exists.
public static boolean containsName(String type) {
return Stream.of(InstantiationTypes.values())
- .anyMatch(instType -> type.equals(instType.getValue()));
+ .anyMatch(instType -> type.equals(instType.getValue()));
}
}
HEAT_PARAMETERS("heatParameters", null),
GENERATED_FROM_ID("generatedFromId", null),
-
// end artifacts
-
//property
DEFINITION("definition", null),
DEFAULT_VALUE("defaultValue", null),
IS_VSP_ARCHIVED("isVspArchived", GraphPropertyEnum.IS_VSP_ARCHIVED),
CI_IS_ORIGIN_ARCHIVED("isOriginArchived", null),
- //Interface Operation
- IO_OPERATION_TYPE("operationType",null),
- IO_INPUT_PARAMETERS("inputParams",null),
- IO_OUTPUT_PARAMETERS("outputParams",null),
+ //Interface Operation
+ IO_OPERATION_TYPE("operationType", null),
+ IO_INPUT_PARAMETERS("inputParams", null),
+ IO_OUTPUT_PARAMETERS("outputParams", null),
IO_PARAM_NAME("paramName", null),
IO_PARAM_ID("paramId", null),
IO_NAME("name", null),
- IO_MANDATORY("mandatory", null),
- IO_TYPE("type", null),
- IO_PROPERTY("property", null),
- IO_WORKFLOW_NAME("workflowName", null),
- IO_WORKFLOW_VERSION("workflowVersion", null),
- IO_WORKFLOW_ID("workflowId", null),
- IO_WORKFLOW_VERSION_ID("workflowVersionId", null),
+ IO_MANDATORY("mandatory", null),
+ IO_TYPE("type", null),
+ IO_PROPERTY("property", null),
+ IO_WORKFLOW_NAME("workflowName", null),
+ IO_WORKFLOW_VERSION("workflowVersion", null),
+ IO_WORKFLOW_ID("workflowId", null),
+ IO_WORKFLOW_VERSION_ID("workflowVersionId", null),
IO_WORKFLOW_ASSOCIATION_TYPE("workflowAssociationType", null),
//Interface
@ToString.Exclude
private final GraphPropertyEnum storedAs;
- @JsonValue
- public String getPresentation() {
- return presentation;
- }
-
public static String getPresentationByGraphProperty(GraphPropertyEnum property) {
for (JsonPresentationFields currPresentation : JsonPresentationFields.values()) {
if (currPresentation.getStoredAs() == property) {
return null;
}
+ @JsonValue
+ public String getPresentation() {
+ return presentation;
+ }
+
}
import java.util.List;
import java.util.Map;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+@Getter
+@AllArgsConstructor
public class JsonPresentationFieldsExtractor {
- private Map<String, Object> properties;
-
- public JsonPresentationFieldsExtractor(Map<String, Object> properties) {
- this.properties = properties;
- }
+ private final Map<String, Object> properties;
public String getUniqueId() {
return (String) properties.get(JsonPresentationFields.UNIQUE_ID.getPresentation());
}
public ResourceTypeEnum getResourceType() {
- return ResourceTypeEnum.valueOf((String)properties.get(JsonPresentationFields.RESOURCE_TYPE.getPresentation()));
+ return ResourceTypeEnum.valueOf((String) properties.get(JsonPresentationFields.RESOURCE_TYPE.getPresentation()));
}
public String getToscaResourceName() {
*/
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
import lombok.Getter;
+@Getter
+@AllArgsConstructor
public enum MetadataKeyEnum {
- METADATA_KEYS("metadataKeys"),
- NAME("name"),
+ METADATA_KEYS("metadataKeys"),
+ NAME("name"),
MANDATORY("mandatory"),
VALID_VALUES("validValues");
- @Getter
private final String name;
- MetadataKeyEnum(final String name) {
- this.name = name;
- }
-
}
PROPERTIES(NodeFilterConstraintType.PROPERTIES_PARAM_NAME),
CAPABILITIES(NodeFilterConstraintType.CAPABILITIES_PARAM_NAME);
- private final String type;
-
// Those values are needed as constants for Swagger allowedValues param
public static final String PROPERTIES_PARAM_NAME = "properties";
public static final String CAPABILITIES_PARAM_NAME = "capabilities";
+ private final String type;
/**
* Parse a String to the related {@link NodeFilterConstraintType}.
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum NodeTypeEnum {
User("user"),
Service("service"),
AnnotationType("annotationType"),
Component("component");
- private String name;
-
- NodeTypeEnum(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
+ private final String name;
public static NodeTypeEnum getByName(String name) {
for (NodeTypeEnum inst : NodeTypeEnum.values()) {
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum OriginTypeEnum {
PRODUCT("Product", "Product", "product instance", ComponentTypeEnum.PRODUCT, false),
SERVICE("Service", "Service", "service instance", ComponentTypeEnum.SERVICE, false),
ServiceProxy("Service Proxy", "Service Proxy", "service proxy", ComponentTypeEnum.RESOURCE, false),
ServiceSubstitution("Service Substitution", "Service Substitution", "service substitution", ComponentTypeEnum.RESOURCE, false);
- private String value;
- private String displayValue;
- private String instanceType;
- private ComponentTypeEnum componentType;
- private boolean isAtomicType;
-
- OriginTypeEnum(String value, String displayValue, String instanceType, ComponentTypeEnum componentType, boolean isAtomicType) {
- this.value = value;
- this.displayValue = displayValue;
- this.instanceType = instanceType;
- this.componentType = componentType;
- this.isAtomicType = isAtomicType;
- }
-
- public String getValue() {
- return value;
- }
-
- public String getDisplayValue() {
- return displayValue;
- }
-
- public String getInstanceType() {
- return instanceType;
- }
-
- public ComponentTypeEnum getComponentType() {
- return componentType;
- }
-
- public boolean isAtomicType() {
- return isAtomicType;
- }
+ private final String value;
+ private final String displayValue;
+ private final String instanceType;
+ private final ComponentTypeEnum componentType;
+ private final boolean isAtomicType;
public static OriginTypeEnum findByValue(String value) {
OriginTypeEnum ret = null;
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
public enum PortMirroringEnum {
CISCO_VENDOR_NAME("CISCO"),
CISCO_VENDOR_MODEL_NUMBER("4500x");
- private String value;
-
- public String getValue() {
- return value;
- }
+ private final String value;
- PortMirroringEnum(String value) {
- this.value = value;
- }
}
package org.openecomp.sdc.be.datatypes.enums;
+import lombok.Getter;
+
+@Getter
public enum PromoteVersionEnum {
-
+
NONE,
MINOR,
MAJOR
package org.openecomp.sdc.be.datatypes.enums;
import java.util.Arrays;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
/**
* Resource Type Enum
*
* @author mshitrit
*/
+@Getter
+@AllArgsConstructor
public enum ResourceTypeEnum {
VFC("VFC"/* (Virtual Function Component)"*/, true),
ServiceProxy("ServiceProxy", true),
//Generic VFC/VF/PNF/Service Type
ABSTRACT("Abstract", true),
- SERVICE("Service"/*(Network Service)"*/,false);
+ SERVICE("Service"/*(Network Service)"*/, false);
private final String value;
private final boolean isAtomicType;
- ResourceTypeEnum(final String value, final boolean isAtomicType) {
- this.value = value;
- this.isAtomicType = isAtomicType;
- }
-
- public String getValue() {
- return value;
- }
-
- public boolean isAtomicType() {
- return isAtomicType;
- }
-
public static ResourceTypeEnum getType(final String type) {
if (type == null) {
return null;