All Downloads are FREE. Search and download functionalities are using the official Maven repository.

butterknife.compiler.Parameter Maven / Gradle / Ivy

The newest version!
package butterknife.compiler;

import com.squareup.javapoet.TypeName;

/** Represents a parameter type and its position in the listener method. */
final class Parameter {
  static final Parameter[] NONE = new Parameter[0];

  private final int listenerPosition;
  private final TypeName type;

  Parameter(int listenerPosition, TypeName type) {
    this.listenerPosition = listenerPosition;
    this.type = type;
  }

  int getListenerPosition() {
    return listenerPosition;
  }

  TypeName getType() {
    return type;
  }

  public boolean requiresCast(String toType) {
    return !type.toString().equals(toType);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy