Merge automation from ECOMP's repository
[vid.git] / vid-automation / src / main / java / org / onap / sdc / ci / tests / devObjects / GraphPropertyEnum.java
1 package org.onap.sdc.ci.tests.devObjects;
2
3 import java.util.ArrayList;
4 import java.util.List;
5
6
7
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);
39
40         private String property;
41         private Class clazz;
42         private boolean unique;
43         private boolean indexed;
44
45         GraphPropertyEnum(String property, Class clazz, boolean unique, boolean indexed) {
46                 this.property = property;
47                 this.clazz = clazz;
48                 this.unique = unique;
49                 this.indexed = indexed;
50         }
51         
52         public static GraphPropertyEnum getByProperty(String property){
53                 for(GraphPropertyEnum currProperty :GraphPropertyEnum.values()){
54                         if(currProperty.getProperty().equals(property)){
55                                 return currProperty;
56                         }
57                 }
58                 return null;
59         }
60
61         public String getProperty() {
62                 return property;
63         }
64
65         public void setProperty(String property) {
66                 this.property = property;
67         }
68
69         public Class getClazz() {
70                 return clazz;
71         }
72
73         public void setClazz(Class clazz) {
74                 this.clazz = clazz;
75         }
76
77         public boolean isUnique() {
78                 return unique;
79         }
80
81         public void setUnique(boolean unique) {
82                 this.unique = unique;
83         }
84
85         public boolean isIndexed() {
86                 return indexed;
87         }
88
89         public void setIndexed(boolean indexed) {
90                 this.indexed = indexed;
91         }
92
93         public static List<String> getAllProperties() {
94
95                 List<String> arrayList = new ArrayList<String>();
96
97                 for (GraphPropertyEnum graphProperty : GraphPropertyEnum.values()) {
98                         arrayList.add(graphProperty.getProperty());
99                 }
100
101                 return arrayList;
102         }
103 }