15
15
import org .apache .avro .io .EncoderFactory ;
16
16
import org .apache .avro .reflect .ReflectData ;
17
17
18
- import com .fasterxml .jackson .core .JsonProcessingException ;
19
18
import com .fasterxml .jackson .databind .JavaType ;
20
19
import com .fasterxml .jackson .databind .JsonMappingException ;
21
20
import com .fasterxml .jackson .dataformat .avro .AvroMapper ;
@@ -38,7 +37,7 @@ public byte[] apply(Schema schema, Object originalObject) {
38
37
/**
39
38
* Functor of {@link #getJacksonSchema(Type)}
40
39
*/
41
- public static final Function <Type , Schema > getJacksonSchema = new Function <Type , Schema >() {
40
+ public static final Function <Type , Schema > getJacksonSchema = new Function <Type , Schema >() {
42
41
@ Override
43
42
public Schema apply (Type input ) {
44
43
return getJacksonSchema (input );
@@ -48,7 +47,7 @@ public Schema apply(Type input) {
48
47
* Functor of {@link #jacksonDeserialize(Schema, Type, byte[])} which uses {@link Object} as the target type,
49
48
* requiring the use of native type IDs
50
49
*/
51
- public static final BiFunction <Schema , byte [], Object > jacksonDeserializer = new BiFunction <Schema , byte [], Object >() {
50
+ public static final BiFunction <Schema , byte [], Object > jacksonDeserializer = new BiFunction <Schema , byte [], Object >() {
52
51
@ Override
53
52
public Object apply (Schema schema , byte [] originalObject ) {
54
53
return jacksonDeserialize (schema , Object .class , originalObject );
@@ -57,7 +56,7 @@ public Object apply(Schema schema, byte[] originalObject) {
57
56
/**
58
57
* Functor of {@link #getApacheSchema(Type)}
59
58
*/
60
- public static final Function <Type , Schema > getApacheSchema = new Function <Type , Schema >() {
59
+ public static final Function <Type , Schema > getApacheSchema = new Function <Type , Schema >() {
61
60
@ Override
62
61
public Schema apply (Type input ) {
63
62
return getApacheSchema (input );
@@ -66,7 +65,7 @@ public Schema apply(Type input) {
66
65
/**
67
66
* Functor of {@link #apacheDeserialize(Schema, byte[])}
68
67
*/
69
- public static final BiFunction <Schema , byte [], Object > apacheDeserializer = new BiFunction <Schema , byte [], Object >() {
68
+ public static final BiFunction <Schema , byte [], Object > apacheDeserializer = new BiFunction <Schema , byte [], Object >() {
70
69
@ Override
71
70
public Object apply (Schema first , byte [] second ) {
72
71
return apacheDeserialize (first , second );
@@ -75,7 +74,7 @@ public Object apply(Schema first, byte[] second) {
75
74
/**
76
75
* Functor of {@link #apacheSerialize(Schema, Object)}
77
76
*/
78
- public static final BiFunction <Schema , Object , byte []> apacheSerializer = new BiFunction <Schema , Object , byte []>() {
77
+ public static final BiFunction <Schema , Object , byte []> apacheSerializer = new BiFunction <Schema , Object , byte []>() {
79
78
@ Override
80
79
public byte [] apply (Schema schema , Object originalObject ) {
81
80
return apacheSerialize (schema , originalObject );
@@ -93,8 +92,7 @@ public byte[] apply(Schema schema, Object originalObject) {
93
92
@ SuppressWarnings ({"unchecked" , "SuspiciousMethodCalls" , "rawtypes" })
94
93
@ Override
95
94
protected Schema createSchema (Type type , Map <String , Schema > names ) {
96
- /*
97
- * Note, we abuse the fact that we can stick whatever we want into "names" and it won't interfere as long as we don't use String
95
+ /* Note, we abuse the fact that we can stick whatever we want into "names" and it won't interfere as long as we don't use String
98
96
* keys. To persist and look up type variable information, we watch for ParameterizedTypes, TypeVariables, and Classes with
99
97
* generic superclasses to extract type variable information and store it in the map. This allows full type variable resolution
100
98
* when building a schema from reflection data.
0 commit comments