-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocialNetworkStatus.java
More file actions
39 lines (33 loc) · 881 Bytes
/
SocialNetworkStatus.java
File metadata and controls
39 lines (33 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/** Wrappper class for an enum used to check the status of an operation.
* @author Billy Barbaro
*/
public class SocialNetworkStatus {
// Variable to hold the state of our enum
private Status currentStatus;
// The enum that contains the possible status of our operations.
public enum Status {
ALREADY_VALID,
INVALID_USERS,
INVALID_DATE,
INVALID_DISTANCE,
ALREADY_ACTIVE,
ALREADY_INACTIVE,
SUCCESS
};
/** Creates a new status and makes the default status success */
public SocialNetworkStatus() {
currentStatus = null;
}
/** Gets the current status
* @return Status the current status of an operation
*/
public Status getStatus() {
return currentStatus;
}
/** Sets a new status for an operation
* @param newStatus changes the status of an operation
*/
public void setStatus(Status newStatus) {
currentStatus = newStatus;
}
}