我正在尝试从Firebase 2.X迁移到最新版本。有没有办法继续使用杰克逊注释?这将大大减少我迁移的速度。
示例:
public final class Example {
@JsonProperty("field_example")
private int myField;
Example() {
}
}
gradle文件
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.6'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6'
答案 0 :(得分:0)
如果您尝试重命名存储特定JavaBean字段的密钥,请使用注释@ PropertyName(" new_name")来覆盖标准JavaBean命名约定。您可以在成员字段(如果没有访问者的公共字段)或获取/设置它的公共访问器方法上使用它。