-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoundDataEntity.java
More file actions
167 lines (149 loc) · 4.01 KB
/
SoundDataEntity.java
File metadata and controls
167 lines (149 loc) · 4.01 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
package net.theevilreaper.vulpes.api.model.sound;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import net.theevilreaper.vulpes.api.generator.VulpesGenerator;
import net.theevilreaper.vulpes.api.model.VulpesModel;
import java.util.UUID;
/**
* Represents sound data in the system. This class is used as an entity for persistence
* with JPA and Micronaut Data. It contains details related to sound such as name, source,
* volume, and pitch.
* <p>
* This class is mapped to the database table "vulpes_sound_data" and contains fields that
* are automatically persisted by the JPA and Micronaut Data layers.
* </p>
*/
@Entity(name = "sound_data")
public class SoundDataEntity implements VulpesModel {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
@VulpesGenerator
private UUID id;
private String name;
private String source;
private double volume;
private double pitch;
/**
* Default constructor for JPA and Micronaut Data.
* <p>
* This constructor is required for the JPA provider to instantiate the entity.
* </p>
*/
public SoundDataEntity() {
// No-argument constructor for JPA
}
/**
* Constructs a new {@link SoundDataEntity} with the specified values.
*
* @param id the unique identifier of the sound data
* @param name the name of the sound data
* @param source the source file or location of the sound
* @param volume the volume level of the sound
* @param pitch the pitch of the sound
*/
public SoundDataEntity(UUID id, String name, String source, double volume, double pitch) {
this.id = id;
this.name = name;
this.source = source;
this.volume = volume;
this.pitch = pitch;
}
// Getters and setters for each field
/**
* Returns the unique identifier of the sound data
*
* @return the unique identifier of the sound data
*/
public UUID getId() {
return id;
}
/**
* Sets the unique identifier of the sound data
*
* @param id the unique identifier to set
*/
public void setId(UUID id) {
this.id = id;
}
/**
* Returns the name of the sound data
*
* @return the name of the sound data
*/
public String getName() {
return name;
}
/**
* Sets the name of the sound data
*
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* Returns the source of the sound data
*
* @return the source of the sound data
*/
public String getSource() {
return source;
}
/**
* Sets the source of the sound data
*
* @param source the source to set
*/
public void setSource(String source) {
this.source = source;
}
/**
* Returns the volume level of the sound data
*
* @return the volume level of the sound data
*/
public double getVolume() {
return volume;
}
/**
* Sets the volume level of the sound data
*
* @param volume the volume to set
*/
public void setVolume(double volume) {
this.volume = volume;
}
/**
* Returns the pitch of the sound data
*
* @return the pitch of the sound data
*/
public double getPitch() {
return pitch;
}
/**
* Sets the pitch of the sound data
*
* @param pitch the pitch to set
*/
public void setPitch(double pitch) {
this.pitch = pitch;
}
/**
* Provides a string representation of the SoundData
*
* @return
*/
@Override
public String toString() {
return "SoundData{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", source='" + source + '\'' +
", volume=" + volume +
", pitch=" + pitch +
'}';
}
}