Passed
Pull Request — master (#7)
by
unknown
02:52
created

net.labymod.serverapi.discord.Game   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 19
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setGameMode(String) 0 4 1
A setStartTime(Instant) 0 4 1
A setEndTime(Instant) 0 4 1
1
package net.labymod.serverapi.discord;
2
3
import java.time.Instant;
4
import java.util.Observable;
5
6
import lombok.Builder;
7
import lombok.Getter;
8
import lombok.NonNull;
9
10
@Builder
11
@Getter
12
public class Game extends Observable {
13
	@NonNull
14
	private String gameMode;
15
	private Instant startTime;
0 ignored issues
show
Comprehensibility Code Smell introduced by
Remove the "startTime" field and declare it as a local variable in the relevant methods.
Loading history...
16
	private Instant endTime;
0 ignored issues
show
Comprehensibility Code Smell introduced by
Remove the "endTime" field and declare it as a local variable in the relevant methods.
Loading history...
17
	
18
	public void setGameMode(String gameMode) {
19
		this.gameMode = gameMode;
20
		setChanged();
21
		notifyObservers();
22
	}
23
	
24
	public void setStartTime(Instant startTime) {
25
		this.startTime = startTime;
26
		setChanged();
27
		notifyObservers();
28
	}
29
	
30
	public void setEndTime(Instant endTime) {
31
		this.endTime = endTime;
32
		setChanged();
33
		notifyObservers();
34
	}
35
}
36