Java Code Examples for java.time.Period#toString()

The following examples show how to use java.time.Period#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PeriodConverterFactory.java    From dolphin-platform with Apache License 2.0 5 votes vote down vote up
@Override
public String convertToDolphin(final Period value) throws ValueConverterException{
    if(value == null) {
        return null;
    }
    try {
        return value.toString();
    } catch (Exception e) {
        throw new ValueConverterException("Can not convert from Periode", e);
    }
}
 
Example 2
Source File: FmtPeriod.java    From super-csv with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @throws SuperCsvCellProcessorException if value is null or not a Period
 */
public Object execute(final Object value, final CsvContext context) {
	validateInputNotNull(value, context);
	if( !(value instanceof Period) ) {
		throw new SuperCsvCellProcessorException(Period.class, value, context, this);
	}
	final Period period = (Period) value;
	final String result = period.toString();

	return next.execute(result, context);
}
 
Example 3
Source File: PeriodWriteConverter.java    From bearchoke with Apache License 2.0 5 votes vote down vote up
@Override
public String convert(Period period) {
    String result = null;

    if (log.isTraceEnabled()) {
        log.trace("Converting Period {} to string", period.toString());
    }

    result = period.toString();

    return result;
}
 
Example 4
Source File: PeriodFormatter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public String print(Period object, Locale locale) {
	return object.toString();
}
 
Example 5
Source File: RecurrenceRule.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
public static String convertPeriod(Period period) {
    return period != null ? period.toString() : null;
}
 
Example 6
Source File: PeriodStringConverter.java    From google-cloud-spanner-hibernate with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public String convertToDatabaseColumn(Period attribute) {
    return attribute.toString();
}
 
Example 7
Source File: PeriodFormatter.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public String print(Period object, Locale locale) {
	return object.toString();
}
 
Example 8
Source File: PeriodFormatter.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String print(Period object, Locale locale) {
	return object.toString();
}
 
Example 9
Source File: PeriodFormatter.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public String print(Period object, Locale locale) {
	return object.toString();
}
 
Example 10
Source File: PeriodXmlAdapter.java    From threeten-jaxb with Apache License 2.0 4 votes vote down vote up
@Override
public String marshal(Period value) {
    return value != null ? value.toString() : null;
}
 
Example 11
Source File: PeriodTypeAdapter.java    From javers with Apache License 2.0 4 votes vote down vote up
@Override
public String serialize(Period sourceValue) {
    return sourceValue.toString();
}
 
Example 12
Source File: Frequency.java    From Strata with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a periodic frequency.
 *
 * @param period  the period to represent
 */
private Frequency(Period period) {
  this(period, period.toString());
}