Question: Imagine you are developing a software system to manage a multimedia library that includes music tracks, their availability, ratings, related artists, and genres. Create a
Imagine you are developing a software system to manage a multimedia library that includes music tracks, their availability, ratings, related artists, and genres.
Create a class named MultimediaLibrary with the following properties:
A String property named trackName for the music track's title.
A boolean property named available to indicate whether the track is currently available.
An int property named rating to represent the user rating of the track, which should range from to
An Artist object property named artist representing the artist of the track.
An array of String objects named genres to list the genres associated with the track.
Implement getter and setter methods for these properties. For trackName, ensure the setter rejects null or empty strings. For rating, the setter should validate that the input is within the acceptable range to For the artist property, your getter should return a new instance or a clone of the Artist object to prevent the original object from being altered externally. Similarly, for the genres array, return a copy of the array in the getter to avoid external modifications to the original array. In the setters for artist and genres, ensure that the incoming values are not null. In the setters, if the value is changed return true, otherwise false.
Java language please!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
