com.appsingularity.postman.compiler.writers.fields.StringListFieldWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of postman-compiler Show documentation
Show all versions of postman-compiler Show documentation
Easy parceling for Android.
package com.appsingularity.postman.compiler.writers.fields;
import android.support.annotation.NonNull;
import com.appsingularity.postman.compiler.writers.AbsCollectedFieldWriter;
import com.squareup.javapoet.MethodSpec;
import javax.lang.model.element.Element;
public class StringListFieldWriter extends AbsCollectedFieldWriter {
public StringListFieldWriter(@NonNull Element element) {
super(element);
}
@Override
public void writeShipMethod(@NonNull MethodSpec.Builder shipMethod) {
shipMethod.addStatement("dest.writeStringList(source.$L)", mElement.getSimpleName().toString());
}
@Override
public void writeReceiveMethod(@NonNull MethodSpec.Builder receiveMethod) {
receiveMethod.addStatement("target.$L = in.createStringArrayList()", mElement.getSimpleName().toString());
}
}