Skip to content

Commit

Permalink
Improve javadoc and reduce scope to package private for jackson classes
Browse files Browse the repository at this point in the history
  • Loading branch information
derTobsch committed Dec 21, 2024
1 parent 4cd50b9 commit 1f35e58
Show file tree
Hide file tree
Showing 14 changed files with 530 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,102 @@

import static java.util.stream.Collectors.toList;

public class JacksonChristianHoliday implements ChristianHoliday {
/**
* {@inheritDoc}
*/
class JacksonChristianHoliday implements ChristianHoliday {

private final de.focus_shift.jollyday.jackson.mapping.ChristianHoliday christianHoliday;

public JacksonChristianHoliday(de.focus_shift.jollyday.jackson.mapping.ChristianHoliday christianHoliday) {
JacksonChristianHoliday(de.focus_shift.jollyday.jackson.mapping.ChristianHoliday christianHoliday) {
this.christianHoliday = christianHoliday;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public ChristianHolidayType type() {
return ChristianHolidayType.valueOf(christianHoliday.getType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Chronology chronology() {
return christianHoliday.getChronology() == ChronologyType.JULIAN
? JulianChronology.INSTANCE
: IsoChronology.INSTANCE;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return christianHoliday.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return christianHoliday.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(christianHoliday.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return christianHoliday.getValidFrom() == null
? null
: Year.of(christianHoliday.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return christianHoliday.getValidTo() == null
? null
: Year.of(christianHoliday.getValidTo());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public YearCycle cycle() {
return christianHoliday.getEvery() == null
? YearCycle.EVERY_YEAR
: YearCycle.valueOf(christianHoliday.getEvery().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public List<MovingCondition> conditions() {
return christianHoliday.getMovingCondition().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import java.util.stream.Stream;


/**
* {@inheritDoc}
*/
public class JacksonConfiguration implements Configuration {

private final de.focus_shift.jollyday.jackson.mapping.Configuration xmlConfiguration;
Expand All @@ -14,21 +16,41 @@ public JacksonConfiguration(de.focus_shift.jollyday.jackson.mapping.Configuratio
this.xmlConfiguration = xmlConfiguration;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Holidays holidays() {
return new JacksonHolidays(xmlConfiguration.getHolidays());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Stream<Configuration> subConfigurations() {
return xmlConfiguration.getSubConfigurations().stream().map(JacksonConfiguration::new);
}
/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/

@Override
public String hierarchy() {
return xmlConfiguration.getHierarchy();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String description() {
return xmlConfiguration.getDescription();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@
import java.io.InputStream;
import java.net.URL;


/**
* {@inheritDoc}
*/
public class JacksonConfigurationService implements ConfigurationService {

private static final XMLUtil xmlUtil = new XMLUtil();

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Configuration getConfiguration(ManagerParameter parameter) {
final URL resourceUrl = parameter.createResourceUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,78 @@

import java.time.Year;

public class JacksonEthiopianOrthodoxHoliday implements EthiopianOrthodoxHoliday {
/**
* {@inheritDoc}
*/
class JacksonEthiopianOrthodoxHoliday implements EthiopianOrthodoxHoliday {

private final de.focus_shift.jollyday.jackson.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday;

public JacksonEthiopianOrthodoxHoliday(de.focus_shift.jollyday.jackson.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday) {
JacksonEthiopianOrthodoxHoliday(de.focus_shift.jollyday.jackson.mapping.EthiopianOrthodoxHoliday ethiopianOrthodoxHoliday) {
this.ethiopianOrthodoxHoliday = ethiopianOrthodoxHoliday;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return ethiopianOrthodoxHoliday.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return ethiopianOrthodoxHoliday.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(ethiopianOrthodoxHoliday.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public EthiopianOrthodoxHolidayType type() {
return EthiopianOrthodoxHolidayType.valueOf(ethiopianOrthodoxHoliday.getType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return ethiopianOrthodoxHoliday.getValidFrom() == null
? null
: Year.of(ethiopianOrthodoxHoliday.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return ethiopianOrthodoxHoliday.getValidTo() == null
? null
: Year.of(ethiopianOrthodoxHoliday.getValidTo());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public YearCycle cycle() {
return ethiopianOrthodoxHoliday.getEvery() == null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,92 @@

import static java.util.stream.Collectors.toList;


public class JacksonFixed implements Fixed {
/**
* {@inheritDoc}
*/
class JacksonFixed implements Fixed {

private final XMLUtil xmlUtil = new XMLUtil();

private final de.focus_shift.jollyday.jackson.mapping.Fixed fixed;

public JacksonFixed(de.focus_shift.jollyday.jackson.mapping.Fixed fixed) {
JacksonFixed(de.focus_shift.jollyday.jackson.mapping.Fixed fixed) {
this.fixed = fixed;
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public MonthDay day() {
return MonthDay.of(xmlUtil.getMonth(fixed.getMonth()), fixed.getDay());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public String descriptionPropertiesKey() {
return fixed.getDescriptionPropertiesKey();
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public HolidayType officiality() {
return fixed.getLocalizedType() == null
? HolidayType.PUBLIC_HOLIDAY
: HolidayType.valueOf(fixed.getLocalizedType().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validFrom() {
return fixed.getValidFrom() == null
? null
: Year.of(fixed.getValidFrom());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public Year validTo() {
return fixed.getValidTo() == null
? null
: Year.of(fixed.getValidTo());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public YearCycle cycle() {
return fixed.getEvery() == null
? YearCycle.EVERY_YEAR
: YearCycle.valueOf(fixed.getEvery().name());
}

/**
* {@inheritDoc}
*
* @return {@inheritDoc}
*/
@Override
public List<MovingCondition> conditions() {
return fixed.getMovingCondition().stream()
Expand Down
Loading

0 comments on commit 1f35e58

Please sign in to comment.