@@ -32,6 +32,10 @@ public class SongPayload {
3232
3333 private @Valid Integer stars ;
3434
35+ private @Valid Float length ;
36+
37+ private @Valid Double playtime ;
38+
3539
3640
3741
@@ -113,6 +117,32 @@ public class SongPayload {
113117 this.stars = stars;
114118 }
115119
120+
121+ /**
122+ * Length of the song in minutes
123+ */
124+ @JsonProperty (" length" )@DecimalMin (value = " 0.5" , inclusive = true )@DecimalMax (value = " 10.5" , inclusive = true )
125+ public Float getLength () {
126+ return length;
127+ }
128+
129+ public void setLength (Float length ) {
130+ this.length = length;
131+ }
132+
133+
134+ /**
135+ * Playtime of the song in minutes
136+ */
137+ @JsonProperty (" playtime" )@DecimalMin (value = " 1.5" , inclusive = false )@DecimalMax (value = " 11.5" , inclusive = false )
138+ public Double getPlaytime () {
139+ return playtime;
140+ }
141+
142+ public void setPlaytime (Double playtime ) {
143+ this.playtime = playtime;
144+ }
145+
116146 @Override
117147 public boolean equals (Object o ) {
118148 if (this == o ) {
@@ -128,12 +158,14 @@ public class SongPayload {
128158 Objects.equals(this .uri , songPayload .uri ) &&
129159 Objects.equals(this .email , songPayload .email ) &&
130160 Objects.equals(this .rating , songPayload .rating ) &&
131- Objects.equals(this .stars , songPayload .stars );
161+ Objects.equals(this .stars , songPayload .stars ) &&
162+ Objects.equals(this .length , songPayload .length ) &&
163+ Objects.equals(this .playtime , songPayload .playtime );
132164 }
133165
134166 @Override
135167 public int hashCode () {
136- return Objects.hash(id , title , uri , email , rating , stars );
168+ return Objects.hash(id , title , uri , email , rating , stars , length , playtime );
137169 }
138170
139171 @Override
@@ -146,6 +178,8 @@ public class SongPayload {
146178 " email: " + toIndentedString (email ) + " \\ n" +
147179 " rating: " + toIndentedString (rating ) + " \\ n" +
148180 " stars: " + toIndentedString (stars ) + " \\ n" +
181+ " length: " + toIndentedString (length ) + " \\ n" +
182+ " playtime: " + toIndentedString (playtime ) + " \\ n" +
149183 " }" ;
150184 }
151185
0 commit comments