Open Kilda Java Documentation
ActivityType.java
Go to the documentation of this file.
1 package org.openkilda.log.constants;
2 
4 
5 public enum ActivityType {
6 
25  RESET_2FA(19L),
28 
29  private Long id;
30  private ActivityTypeEntity activityTypeEntity;
31 
37  private ActivityType(final Long id) {
38  this.id = id;
39  }
40 
46  public Long getId() {
47  return id;
48  }
49 
56  return activityTypeEntity;
57  }
58 
64  public void setActivityTypeEntity(final ActivityTypeEntity activityTypeEntity) {
65  if (this.activityTypeEntity == null) {
66  this.activityTypeEntity = activityTypeEntity;
67  }
68  }
69 
76  public static ActivityType getActivityByName(final String name) {
77  ActivityType activityType = null;
78  for (ActivityType type : ActivityType.values()) {
79  if (type.getActivityTypeEntity().getActivityName().equalsIgnoreCase(name)) {
80  activityType = type;
81  break;
82  }
83  }
84  return activityType;
85  }
86 
93  public static ActivityType getActivityById(final long id) {
94  ActivityType activityType = null;
95  for (ActivityType type : ActivityType.values()) {
96  if (type.getId().equals(id)) {
97  activityType = type;
98  break;
99  }
100  }
101  return activityType;
102  }
103 }
static ActivityType getActivityByName(final String name)
name
Definition: setup.py:24
id
Definition: nodes.py:55
static ActivityType getActivityById(final long id)
void setActivityTypeEntity(final ActivityTypeEntity activityTypeEntity)