Ни 1 условие не прошло? wtf
package com.javarush.task.task14.task1408;
/*
Куриная фабрика
*/
public class Solution {
public static void main(String[] args) {
Hen hen = HenFactory.getHen(Country.BELARUS);
hen.getCountOfEggsPerMonth();
}
static class HenFactory {
static Hen getHen(String country) {
Hen hen = null;
switch (country) {
case Country.BELARUS:
hen = new BelarusianHen();
break;
case Country.RUSSIA:
hen = new RussianHen();
break;
case Country.UKRAINE:
hen = new UkrainianHen();
break;
case Country.MOLDOVA:
hen = new MoldovanHen();
break;
}
return hen;
}
}
static abstract class Hen {
public String getDescription() {
return "Я - курица.";
}
public abstract int getCountOfEggsPerMonth();
}
static class RussianHen extends Hen {
public int getCountOfEggsPerMonth() {
return 10;
}
public String getDescription() {
return super.getDescription() + " Моя страна - Россия. " +
"Я несу " + getCountOfEggsPerMonth() + " яиц в месяц.";
}
}
static class UkrainianHen extends Hen {
public int getCountOfEggsPerMonth() {
return 4;
}
public String getDescription() {
return super.getDescription() + " Моя страна - Украина. " +
"Я несу " + getCountOfEggsPerMonth() + " яиц в месяц.";
}
}
static class MoldovanHen extends Hen {
public int getCountOfEggsPerMonth() {
return 1;
}
public String getDescription() {
return super.getDescription() + " Моя страна - Молдова. " +
"Я несу " + getCountOfEggsPerMonth() + " яиц в месяц.";
}
}
static class BelarusianHen extends Hen {
public int getCountOfEggsPerMonth() {
return 6;
}
public String getDescription() {
return super.getDescription() + " Моя страна - Беларусь. " +
"Я несу " + getCountOfEggsPerMonth() + " яиц в месяц.";
}
}
}