butterknife.compiler.FieldViewBinding Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of butterknife-compiler Show documentation
Show all versions of butterknife-compiler Show documentation
Field and method binding for Android views.
package butterknife.compiler;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeName;
final class FieldViewBinding implements MemberViewBinding {
private final String name;
private final TypeName type;
private final boolean required;
FieldViewBinding(String name, TypeName type, boolean required) {
this.name = name;
this.type = type;
this.required = required;
}
public String getName() {
return name;
}
public TypeName getType() {
return type;
}
public ClassName getRawType() {
if (type instanceof ParameterizedTypeName) {
return ((ParameterizedTypeName) type).rawType;
}
return (ClassName) type;
}
@Override public String getDescription() {
return "field '" + name + "'";
}
public boolean isRequired() {
return required;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy