@Test public void testGetCarrierSlaExcludedDatesNone() throws Exception { final CarrierSlaEntity sla = new CarrierSlaEntity(); final Map<LocalDate, LocalDate> dates = sla.getExcludeDatesAsMap(); assertNotNull(dates); assertTrue(dates.isEmpty()); }
@Override public Map<LocalDate, LocalDate> getExcludeDatesAsMap() { final Map<LocalDate, LocalDate> dates = new HashMap<>(); if (StringUtils.isNotBlank(getExcludeDates())) { final String[] all = StringUtils.split(getExcludeDates(), ','); for (final String range : all) { final int rangePos = range.indexOf(':'); if (rangePos == -1) { final LocalDate date = DateUtils.ldParseSDT(range); if (date != null) { dates.put(date, date); } else { LOG.error(Markers.alert(), "Error reading excluded date during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } else { final LocalDate from = DateUtils.ldParseSDT(range.substring(0, rangePos)); final LocalDate to = DateUtils.ldParseSDT(range.substring(rangePos + 1)); if (from != null && to != null) { dates.put(from, to); } else { LOG.error(Markers.alert(), "Error reading excluded date range during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } } } return dates; }
CarrierSlaEntity implements org.yes.cart.domain.entity.CarrierSla, java.io.Serializable { @Override public Map<LocalDate, LocalDate> getExcludeDatesAsMap() { final Map<LocalDate, LocalDate> dates = new HashMap<>(); if (StringUtils.isNotBlank(getExcludeDates())) { final String[] all = StringUtils.split(getExcludeDates(), ','); for (final String range : all) { final int rangePos = range.indexOf(':'); if (rangePos == -1) { final LocalDate date = DateUtils.ldParseSDT(range); if (date != null) { dates.put(date, date); } else { LOG.error(Markers.alert(), "Error reading excluded date during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } else { final LocalDate from = DateUtils.ldParseSDT(range.substring(0, rangePos)); final LocalDate to = DateUtils.ldParseSDT(range.substring(rangePos + 1)); if (from != null && to != null) { dates.put(from, to); } else { LOG.error(Markers.alert(), "Error reading excluded date range during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } } } return dates; } }
CarrierSlaEntity implements org.yes.cart.domain.entity.CarrierSla, java.io.Serializable { @Override public Map<LocalDate, LocalDate> getExcludeDatesAsMap() { final Map<LocalDate, LocalDate> dates = new HashMap<>(); if (StringUtils.isNotBlank(getExcludeDates())) { final String[] all = StringUtils.split(getExcludeDates(), ','); for (final String range : all) { final int rangePos = range.indexOf(':'); if (rangePos == -1) { final LocalDate date = DateUtils.ldParseSDT(range); if (date != null) { dates.put(date, date); } else { LOG.error(Markers.alert(), "Error reading excluded date during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } else { final LocalDate from = DateUtils.ldParseSDT(range.substring(0, rangePos)); final LocalDate to = DateUtils.ldParseSDT(range.substring(rangePos + 1)); if (from != null && to != null) { dates.put(from, to); } else { LOG.error(Markers.alert(), "Error reading excluded date range during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } } } return dates; } CarrierSlaEntity(); }
CarrierSlaEntity implements org.yes.cart.domain.entity.CarrierSla, java.io.Serializable { @Override public Map<LocalDate, LocalDate> getExcludeDatesAsMap() { final Map<LocalDate, LocalDate> dates = new HashMap<>(); if (StringUtils.isNotBlank(getExcludeDates())) { final String[] all = StringUtils.split(getExcludeDates(), ','); for (final String range : all) { final int rangePos = range.indexOf(':'); if (rangePos == -1) { final LocalDate date = DateUtils.ldParseSDT(range); if (date != null) { dates.put(date, date); } else { LOG.error(Markers.alert(), "Error reading excluded date during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } else { final LocalDate from = DateUtils.ldParseSDT(range.substring(0, rangePos)); final LocalDate to = DateUtils.ldParseSDT(range.substring(rangePos + 1)); if (from != null && to != null) { dates.put(from, to); } else { LOG.error(Markers.alert(), "Error reading excluded date range during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } } } return dates; } CarrierSlaEntity(); @Override String getName(); @Override void setName(final String name); String getDisplayNameInternal(); void setDisplayNameInternal(final String displayNameInternal); @Override I18NModel getDisplayName(); @Override void setDisplayName(final I18NModel displayName); @Override String getDescription(); @Override void setDescription(final String description); String getDisplayDescriptionInternal(); void setDisplayDescriptionInternal(final String displayDescriptionInternal); @Override I18NModel getDisplayDescription(); @Override void setDisplayDescription(final I18NModel displayDescription); @Override Integer getMaxDays(); @Override void setMaxDays(final Integer maxDays); @Override Integer getMinDays(); @Override void setMinDays(final Integer minDays); @Override String getExcludeWeekDays(); @Override void setExcludeWeekDays(final String excludeWeekDays); @Override List<Integer> getExcludeWeekDaysAsList(); @Override String getExcludeDates(); @Override void setExcludeDates(final String excludeDates); @Override Map<LocalDate, LocalDate> getExcludeDatesAsMap(); @Override boolean isGuaranteed(); @Override void setGuaranteed(final boolean guaranteed); @Override boolean isNamedDay(); @Override void setNamedDay(final boolean namedDay); @Override String getSlaType(); @Override void setSlaType(final String slaType); @Override String getScript(); @Override void setScript(final String script); @Override String getExcludeCustomerTypes(); @Override void setExcludeCustomerTypes(final String excludeCustomerTypes); @Override List<String> getExcludeCustomerTypesAsList(); @Override String getSupportedPaymentGateways(); @Override void setSupportedPaymentGateways(final String supportedPaymentGateways); @Override List<String> getSupportedPaymentGatewaysAsList(); void setSupportedPaymentGatewaysAsList(final List<String> supportedPaymentGatewaysAsList); @Override String getSupportedFulfilmentCentres(); @Override void setSupportedFulfilmentCentres(final String supportedFulfilmentCentres); @Override List<String> getSupportedFulfilmentCentresAsList(); void setSupportedFulfilmentCentresAsList(final List<String> supportedFulfilmentCentresAsList); @Override boolean isBillingAddressNotRequired(); @Override void setBillingAddressNotRequired(final boolean billingAddressNotRequired); @Override boolean isDeliveryAddressNotRequired(); @Override void setDeliveryAddressNotRequired(final boolean deliveryAddressNotRequired); @Override String getExternalRef(); @Override void setExternalRef(final String externalRef); @Override Carrier getCarrier(); @Override void setCarrier(final Carrier carrier); @Override Instant getCreatedTimestamp(); @Override void setCreatedTimestamp(final Instant createdTimestamp); @Override Instant getUpdatedTimestamp(); @Override void setUpdatedTimestamp(final Instant updatedTimestamp); @Override String getCreatedBy(); @Override void setCreatedBy(final String createdBy); @Override String getUpdatedBy(); @Override void setUpdatedBy(final String updatedBy); @Override String getGuid(); @Override void setGuid(final String guid); @Override long getCarrierslaId(); @Override long getId(); @Override void setCarrierslaId(final long carrierslaId); @Override long getVersion(); void setVersion(final long version); }
CarrierSlaEntity implements org.yes.cart.domain.entity.CarrierSla, java.io.Serializable { @Override public Map<LocalDate, LocalDate> getExcludeDatesAsMap() { final Map<LocalDate, LocalDate> dates = new HashMap<>(); if (StringUtils.isNotBlank(getExcludeDates())) { final String[] all = StringUtils.split(getExcludeDates(), ','); for (final String range : all) { final int rangePos = range.indexOf(':'); if (rangePos == -1) { final LocalDate date = DateUtils.ldParseSDT(range); if (date != null) { dates.put(date, date); } else { LOG.error(Markers.alert(), "Error reading excluded date during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } else { final LocalDate from = DateUtils.ldParseSDT(range.substring(0, rangePos)); final LocalDate to = DateUtils.ldParseSDT(range.substring(rangePos + 1)); if (from != null && to != null) { dates.put(from, to); } else { LOG.error(Markers.alert(), "Error reading excluded date range during delivery time estimation: {}, sla: {}/{}", range, getGuid(), getName()); } } } } return dates; } CarrierSlaEntity(); @Override String getName(); @Override void setName(final String name); String getDisplayNameInternal(); void setDisplayNameInternal(final String displayNameInternal); @Override I18NModel getDisplayName(); @Override void setDisplayName(final I18NModel displayName); @Override String getDescription(); @Override void setDescription(final String description); String getDisplayDescriptionInternal(); void setDisplayDescriptionInternal(final String displayDescriptionInternal); @Override I18NModel getDisplayDescription(); @Override void setDisplayDescription(final I18NModel displayDescription); @Override Integer getMaxDays(); @Override void setMaxDays(final Integer maxDays); @Override Integer getMinDays(); @Override void setMinDays(final Integer minDays); @Override String getExcludeWeekDays(); @Override void setExcludeWeekDays(final String excludeWeekDays); @Override List<Integer> getExcludeWeekDaysAsList(); @Override String getExcludeDates(); @Override void setExcludeDates(final String excludeDates); @Override Map<LocalDate, LocalDate> getExcludeDatesAsMap(); @Override boolean isGuaranteed(); @Override void setGuaranteed(final boolean guaranteed); @Override boolean isNamedDay(); @Override void setNamedDay(final boolean namedDay); @Override String getSlaType(); @Override void setSlaType(final String slaType); @Override String getScript(); @Override void setScript(final String script); @Override String getExcludeCustomerTypes(); @Override void setExcludeCustomerTypes(final String excludeCustomerTypes); @Override List<String> getExcludeCustomerTypesAsList(); @Override String getSupportedPaymentGateways(); @Override void setSupportedPaymentGateways(final String supportedPaymentGateways); @Override List<String> getSupportedPaymentGatewaysAsList(); void setSupportedPaymentGatewaysAsList(final List<String> supportedPaymentGatewaysAsList); @Override String getSupportedFulfilmentCentres(); @Override void setSupportedFulfilmentCentres(final String supportedFulfilmentCentres); @Override List<String> getSupportedFulfilmentCentresAsList(); void setSupportedFulfilmentCentresAsList(final List<String> supportedFulfilmentCentresAsList); @Override boolean isBillingAddressNotRequired(); @Override void setBillingAddressNotRequired(final boolean billingAddressNotRequired); @Override boolean isDeliveryAddressNotRequired(); @Override void setDeliveryAddressNotRequired(final boolean deliveryAddressNotRequired); @Override String getExternalRef(); @Override void setExternalRef(final String externalRef); @Override Carrier getCarrier(); @Override void setCarrier(final Carrier carrier); @Override Instant getCreatedTimestamp(); @Override void setCreatedTimestamp(final Instant createdTimestamp); @Override Instant getUpdatedTimestamp(); @Override void setUpdatedTimestamp(final Instant updatedTimestamp); @Override String getCreatedBy(); @Override void setCreatedBy(final String createdBy); @Override String getUpdatedBy(); @Override void setUpdatedBy(final String updatedBy); @Override String getGuid(); @Override void setGuid(final String guid); @Override long getCarrierslaId(); @Override long getId(); @Override void setCarrierslaId(final long carrierslaId); @Override long getVersion(); void setVersion(final long version);  }