Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranî)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
In this solution, we're quality control the store class, we need to forbid the caller from misusing
the methods or the constructor, the constructor doesn't receive any parameters.
So there's nothing to check here.
There is nothing to quality control in the setar, because if the caller happens to pass a no instead
of an actual object, the code would already throw a nail pointer exception.
So throwing our own exception would be redundant.
The same thing can be said for ad movie.
However, there's a lot to quality control in the action, first of all, if the store object doesn't
have any movies, then it's not an illegal state to call the method.
You can't return, sell or rent a movie that doesn't exist.
So here, we'll say if movies, that is empty.
We'll throw a new.
Illegal state exception.
Store not in a valid state to perform action.
One more thing we want to check is that the action they want to perform can only be one of three things
sell, rent or return.
So if the caller passes anything else, we need to throw an exception.
So if the auction they pass, if it doesn't equal sell.
Or if it doesn't equal rent.
Or if it doesn't equal return.
Then we'll throw a new illegal argument exception.
Action must be sell, rent or return.
All right, and the color shouldn't be allowed to pass a name that's blank, so if the name is equal
to No.
Or the name is equal to blank.
We'll throw a new illegal argument exception.
Name Kaname Neller Black.
And the last thing we're going to do is forbid the caller from trying to sell a movie that has already
been rented.
So inside, so we're going to check if the movie at the index.
That was a request that is not available.
Then we're going to throw a new illegal state exception, because the state of the movie object that
we're trying to sell is inappropriate for this operation.
We'll just say cannot sell a movie that was rented out.
And that's all the quality control we need to apply and now this method is going to forbid the caller
from misusing it, if the caller does misuse it, their application is going to crash and they're going
to have to fix their code.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.