Java 8 Year - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Year class.

This code example shows how to use the following methods:format, getValue, toString
 
    @Override 
    public void serialize(Year year, JsonGenerator generator, SerializerProvider provider) throws IOException
    { 
        if (useTimestamp(provider)) {
            generator.writeNumber(year.getValue());
        } else { 
            String str = (_formatter == null) ? year.toString() : year.format(_formatter);
            generator.writeString(str);
        } 
    } 
 
    @Override 
    protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
    { 
        JsonIntegerFormatVisitor v2 = visitor.expectIntegerFormat(typeHint);
        if (v2 != null) {
            v2.numberType(JsonParser.NumberType.LONG);
        } 
    } 
6
CodeRank
This code example shows how to use the following methods:isAfter
		// null values are valid 
		if ( value == null ) {
			return true; 
		} 
 
		return value.isAfter( Year.now() );
	} 
} 
5
CodeRank
This code example shows how to use the following methods:isBefore
		// null values are valid 
		if ( value == null ) {
			return true; 
		} 
 
		return value.isBefore( Year.now() );
	} 
} 
5
CodeRank
See Code Examples for Java 8 Year Methods: