Java Code Examples for java.time.Year#getValue()

The following examples show how to use java.time.Year#getValue() . 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: YearTypeDescriptor.java    From hibernate-types with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings({"unchecked"})
@Override
public <X> X unwrap(Year value, Class<X> type, WrapperOptions options) {
    if (value == null) {
        return null;
    }
    if (String.class.isAssignableFrom(type)) {
        return (X) toString(value);
    }
    if (Number.class.isAssignableFrom(type)) {
        Short numericValue = (short) value.getValue();
        return (X) (numericValue);
    }
    throw unknownUnwrap(type);
}
 
Example 2
Source File: YearHandle.java    From alibaba-rsocket-broker with Apache License 2.0 4 votes vote down vote up
public YearHandle(Year o) {
    this.year = o.getValue();
}
 
Example 3
Source File: YearHandle.java    From joyrpc with Apache License 2.0 4 votes vote down vote up
@Override
public void wrap(final Year time) {
    this.year = time.getValue();
}
 
Example 4
Source File: IntCoding.java    From morpheus-core with Apache License 2.0 4 votes vote down vote up
@Override
public final int getCode(Year value) {
    return value == null ? -1 : value.getValue();
}
 
Example 5
Source File: YearAndMonthTest.java    From high-performance-java-persistence with Apache License 2.0 4 votes vote down vote up
@Override
public Short convertToDatabaseColumn(Year attribute) {
    return (short) attribute.getValue();
}
 
Example 6
Source File: YearXmlAdapter.java    From threeten-jaxb with Apache License 2.0 4 votes vote down vote up
@Override
public Integer marshal(Year year) {
    return year != null ? year.getValue() : null;
}
 
Example 7
Source File: IntegerColumnYearMapper.java    From jadira with Apache License 2.0 4 votes vote down vote up
@Override
public String toNonNullString(Year value) {
    return "" + value.getValue();
}
 
Example 8
Source File: IntegerColumnYearMapper.java    From jadira with Apache License 2.0 4 votes vote down vote up
@Override
public Integer toNonNullValue(Year value) {
    return value.getValue();
}