com.jn.easyjson.gson.bean.fieldnaming.GsonFieldNamingStrategyAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easyjson-gson Show documentation
Show all versions of easyjson-gson Show documentation
Adapter easyjson to Google Gson
package com.jn.easyjson.gson.bean.fieldnaming;
import com.google.gson.FieldNamingStrategy;
import com.jn.easyjson.core.bean.propertynaming.BeanPropertyNamingPolicy;
import java.lang.reflect.Field;
/**
* @since 3.2.2
*/
public class GsonFieldNamingStrategyAdapter implements FieldNamingStrategy {
private BeanPropertyNamingPolicy delegate;
public GsonFieldNamingStrategyAdapter(BeanPropertyNamingPolicy policy) {
this.delegate = policy;
}
@Override
public String translateName(Field f) {
return this.delegate.translateName(f, f.getName());
}
}