package hanson.xyz.vpnhotspotmod;

import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import androidx.databinding.DataBinderMapper;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import hanson.xyz.vpnhotspotmod.databinding.ListitemClientBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemInterfaceBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemManageBindingImpl;
import hanson.xyz.vpnhotspotmod.databinding.ListitemRepeaterBindingImpl;
import java.lang.IllegalArgumentException;
import java.lang.Integer;
import java.lang.Object;
import java.lang.Override;
import java.lang.RuntimeException;
import java.lang.String;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class DataBinderMapperImpl extends DataBinderMapper {
  private static final int LAYOUT_LISTITEMCLIENT = 1;

  private static final int LAYOUT_LISTITEMINTERFACE = 2;

  private static final int LAYOUT_LISTITEMMANAGE = 3;

  private static final int LAYOUT_LISTITEMREPEATER = 4;

  private static final SparseIntArray INTERNAL_LAYOUT_ID_LOOKUP = new SparseIntArray(4);

  static {
    INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_client, LAYOUT_LISTITEMCLIENT);
    INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_interface, LAYOUT_LISTITEMINTERFACE);
    INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_manage, LAYOUT_LISTITEMMANAGE);
    INTERNAL_LAYOUT_ID_LOOKUP.put(hanson.xyz.vpnhotspotmod.R.layout.listitem_repeater, LAYOUT_LISTITEMREPEATER);
  }

  @Override
  public ViewDataBinding getDataBinder(DataBindingComponent component, View view, int layoutId) {
    int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
    if(localizedLayoutId > 0) {
      final Object tag = view.getTag();
      if(tag == null) {
        throw new RuntimeException("view must have a tag");
      }
      switch(localizedLayoutId) {
        case  LAYOUT_LISTITEMCLIENT: {
          if ("layout/listitem_client_0".equals(tag)) {
            return new ListitemClientBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for listitem_client is invalid. Received: " + tag);
        }
        case  LAYOUT_LISTITEMINTERFACE: {
          if ("layout/listitem_interface_0".equals(tag)) {
            return new ListitemInterfaceBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for listitem_interface is invalid. Received: " + tag);
        }
        case  LAYOUT_LISTITEMMANAGE: {
          if ("layout/listitem_manage_0".equals(tag)) {
            return new ListitemManageBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for listitem_manage is invalid. Received: " + tag);
        }
        case  LAYOUT_LISTITEMREPEATER: {
          if ("layout/listitem_repeater_0".equals(tag)) {
            return new ListitemRepeaterBindingImpl(component, view);
          }
          throw new IllegalArgumentException("The tag for listitem_repeater is invalid. Received: " + tag);
        }
      }
    }
    return null;
  }

  @Override
  public ViewDataBinding getDataBinder(DataBindingComponent component, View[] views, int layoutId) {
    if(views == null || views.length == 0) {
      return null;
    }
    int localizedLayoutId = INTERNAL_LAYOUT_ID_LOOKUP.get(layoutId);
    if(localizedLayoutId > 0) {
      final Object tag = views[0].getTag();
      if(tag == null) {
        throw new RuntimeException("view must have a tag");
      }
      switch(localizedLayoutId) {
      }
    }
    return null;
  }

  @Override
  public int getLayoutId(String tag) {
    if (tag == null) {
      return 0;
    }
    Integer tmpVal = InnerLayoutIdLookup.sKeys.get(tag);
    return tmpVal == null ? 0 : tmpVal;
  }

  @Override
  public String convertBrIdToString(int localId) {
    String tmpVal = InnerBrLookup.sKeys.get(localId);
    return tmpVal;
  }

  @Override
  public List<DataBinderMapper> collectDependencies() {
    ArrayList<DataBinderMapper> result = new ArrayList<DataBinderMapper>(1);
    result.add(new androidx.databinding.library.baseAdapters.DataBinderMapperImpl());
    return result;
  }

  private static class InnerBrLookup {
    static final SparseArray<String> sKeys = new SparseArray<String>(8);

    static {
      sKeys.put(0, "_all");
      sKeys.put(1, "addresses");
      sKeys.put(2, "client");
      sKeys.put(3, "data");
      sKeys.put(4, "rate");
      sKeys.put(5, "serviceStarted");
      sKeys.put(6, "switchEnabled");
      sKeys.put(7, "title");
    }
  }

  private static class InnerLayoutIdLookup {
    static final HashMap<String, Integer> sKeys = new HashMap<String, Integer>(4);

    static {
      sKeys.put("layout/listitem_client_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_client);
      sKeys.put("layout/listitem_interface_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_interface);
      sKeys.put("layout/listitem_manage_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_manage);
      sKeys.put("layout/listitem_repeater_0", hanson.xyz.vpnhotspotmod.R.layout.listitem_repeater);
    }
  }
}
