protected void assemble(Fields fields) { fields.year = convertField(fields.year); fields.yearOfEra = convertField(fields.yearOfEra); fields.yearOfCentury = convertField(fields.yearOfCentury); fields.centuryOfEra = convertField(fields.centuryOfEra); fields.era = convertField(fields.era); fields.dayOfWeek = convertField(fields.dayOfWeek); fields.dayOfMonth = convertField(fields.dayOfMonth); fields.dayOfYear = convertField(fields.dayOfYear); fields.monthOfYear = convertField(fields.monthOfYear); fields.weekOfWeekyear = convertField(fields.weekOfWeekyear); fields.weekyear = convertField(fields.weekyear); fields.weekyearOfCentury = convertField(fields.weekyearOfCentury); fields.millisOfSecond = convertField(fields.millisOfSecond); fields.millisOfDay = convertField(fields.millisOfDay); fields.secondOfMinute = convertField(fields.secondOfMinute); fields.secondOfDay = convertField(fields.secondOfDay); fields.minuteOfHour = convertField(fields.minuteOfHour); fields.minuteOfDay = convertField(fields.minuteOfDay); fields.hourOfDay = convertField(fields.hourOfDay); fields.hourOfHalfday = convertField(fields.hourOfHalfday); fields.clockhourOfDay = convertField(fields.clockhourOfDay); fields.clockhourOfHalfday = convertField(fields.clockhourOfHalfday); fields.halfdayOfDay = convertField(fields.halfdayOfDay); }
protected void assemble(Fields fields) { // Keep a local cache of converted fields so as not to create redundant // objects. HashMap<Object, Object> converted = new HashMap<Object, Object>(); // Convert duration fields... fields.eras = convertField(fields.eras, converted); fields.centuries = convertField(fields.centuries, converted); fields.years = convertField(fields.years, converted); fields.months = convertField(fields.months, converted); fields.weekyears = convertField(fields.weekyears, converted); fields.weeks = convertField(fields.weeks, converted); fields.days = convertField(fields.days, converted); fields.halfdays = convertField(fields.halfdays, converted); fields.hours = convertField(fields.hours, converted); fields.minutes = convertField(fields.minutes, converted); fields.seconds = convertField(fields.seconds, converted); fields.millis = convertField(fields.millis, converted); // Convert datetime fields... fields.year = convertField(fields.year, converted); fields.yearOfEra = convertField(fields.yearOfEra, converted); fields.yearOfCentury = convertField(fields.yearOfCentury, converted); fields.centuryOfEra = convertField(fields.centuryOfEra, converted); fields.era = convertField(fields.era, converted); fields.dayOfWeek = convertField(fields.dayOfWeek, converted); fields.dayOfMonth = convertField(fields.dayOfMonth, converted); fields.dayOfYear = convertField(fields.dayOfYear, converted); fields.monthOfYear = convertField(fields.monthOfYear, converted); fields.weekOfWeekyear = convertField(fields.weekOfWeekyear, converted); fields.weekyear = convertField(fields.weekyear, converted); fields.weekyearOfCentury = convertField(fields.weekyearOfCentury, converted); fields.millisOfSecond = convertField(fields.millisOfSecond, converted); fields.millisOfDay = convertField(fields.millisOfDay, converted); fields.secondOfMinute = convertField(fields.secondOfMinute, converted); fields.secondOfDay = convertField(fields.secondOfDay, converted); fields.minuteOfHour = convertField(fields.minuteOfHour, converted); fields.minuteOfDay = convertField(fields.minuteOfDay, converted); fields.hourOfDay = convertField(fields.hourOfDay, converted); fields.hourOfHalfday = convertField(fields.hourOfHalfday, converted); fields.clockhourOfDay = convertField(fields.clockhourOfDay, converted); fields.clockhourOfHalfday = convertField(fields.clockhourOfHalfday, converted); fields.halfdayOfDay = convertField(fields.halfdayOfDay, converted); }