1 package org.onap.sdc.ci.tests.devObjects;
3 import java.util.ArrayList;
8 public enum GraphPropertyEnum {
9 // field name class type unique indexed
10 // stored in graph index
11 UNIQUE_ID ("uid", String.class, true, true),
12 LABEL ("nodeLabel", String.class, false, true),
13 JSON ("json", String.class, false, false),
14 METADATA ("metadata", String.class, false, false),
15 VERSION ("version", String.class, false, true),
16 STATE ("state", String.class, false, true),
17 IS_HIGHEST_VERSION ("highestVersion", Boolean.class, false, true),
18 IS_DELETED ("deleted", Boolean.class, false, true),
19 NORMALIZED_NAME ("normalizedName", String.class, false, true),
20 NAME ("name", String.class, false, true),
21 TOSCA_RESOURCE_NAME ("toscaResourceName", String.class, false, true),
22 DISTRIBUTION_STATUS ("distributionStatus", String.class, false, false),
23 RESOURCE_TYPE ("resourceType", String.class, false, true),
24 COMPONENT_TYPE ("componentType", String.class, false, true),
25 UUID ("uuid", String.class, false, true),
26 SYSTEM_NAME ("systemName", String.class, false, true),
27 IS_ABSTRACT ("abstract", Boolean.class, false, true),
28 INVARIANT_UUID ("invariantUuid", String.class, false, true),
29 CSAR_UUID ("csarUuid", String.class, false, true),
30 //used for user (old format, no json for users)
31 USERID ("userId", String.class, true, true),
32 ROLE ("role", String.class, false, false),
33 FIRST_NAME ("firstName", String.class, false, false),
34 LAST_NAME ("lastName", String.class, false, false),
35 EMAIL ("email", String.class, false, false),
36 LAST_LOGIN_TIME ("lastLoginTime", Long.class, false, false),
37 //used for category (old format, no json for categories)
38 ICONS ("icons", String.class, false, false);
40 private String property;
42 private boolean unique;
43 private boolean indexed;
45 GraphPropertyEnum(String property, Class clazz, boolean unique, boolean indexed) {
46 this.property = property;
49 this.indexed = indexed;
52 public static GraphPropertyEnum getByProperty(String property){
53 for(GraphPropertyEnum currProperty :GraphPropertyEnum.values()){
54 if(currProperty.getProperty().equals(property)){
61 public String getProperty() {
65 public void setProperty(String property) {
66 this.property = property;
69 public Class getClazz() {
73 public void setClazz(Class clazz) {
77 public boolean isUnique() {
81 public void setUnique(boolean unique) {
85 public boolean isIndexed() {
89 public void setIndexed(boolean indexed) {
90 this.indexed = indexed;
93 public static List<String> getAllProperties() {
95 List<String> arrayList = new ArrayList<String>();
97 for (GraphPropertyEnum graphProperty : GraphPropertyEnum.values()) {
98 arrayList.add(graphProperty.getProperty());