/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package FiftyOneDegreesTrieV3;

public class Provider {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected Provider(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(Provider obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        FiftyOneDegreesTrieV3JNI.delete_Provider(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public Provider(String fileName) {
    this(FiftyOneDegreesTrieV3JNI.new_Provider__SWIG_0(fileName), true);
  }

  public Provider(String fileName, String propertyString) {
    this(FiftyOneDegreesTrieV3JNI.new_Provider__SWIG_1(fileName, propertyString), true);
  }

  public Provider(String fileName, VectorString propertiesArray) {
    this(FiftyOneDegreesTrieV3JNI.new_Provider__SWIG_2(fileName, VectorString.getCPtr(propertiesArray), propertiesArray), true);
  }

  public VectorString getHttpHeaders() {
    return new VectorString(FiftyOneDegreesTrieV3JNI.Provider_getHttpHeaders(swigCPtr, this), true);
  }

  public VectorString getAvailableProperties() {
    return new VectorString(FiftyOneDegreesTrieV3JNI.Provider_getAvailableProperties(swigCPtr, this), true);
  }

  public String getDataSetName() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetName(swigCPtr, this);
  }

  public String getDataSetFormat() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetFormat(swigCPtr, this);
  }

  public String getDataSetPublishedDate() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetPublishedDate(swigCPtr, this);
  }

  public String getDataSetNextUpdateDate() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetNextUpdateDate(swigCPtr, this);
  }

  public int getDataSetSignatureCount() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetSignatureCount(swigCPtr, this);
  }

  public int getDataSetDeviceCombinations() {
    return FiftyOneDegreesTrieV3JNI.Provider_getDataSetDeviceCombinations(swigCPtr, this);
  }

  public Match getMatch(String userAgent) {
    long cPtr = FiftyOneDegreesTrieV3JNI.Provider_getMatch__SWIG_0(swigCPtr, this, userAgent);
    return (cPtr == 0) ? null : new Match(cPtr, true);
  }

  public Match getMatchForByteArray(byte[] userAgent) {
    long cPtr = FiftyOneDegreesTrieV3JNI.Provider_getMatchForByteArray(swigCPtr, this, userAgent);
    return (cPtr == 0) ? null : new Match(cPtr, true);
  }

  public Match getMatch(MapStringString headers) {
    long cPtr = FiftyOneDegreesTrieV3JNI.Provider_getMatch__SWIG_1(swigCPtr, this, MapStringString.getCPtr(headers), headers);
    return (cPtr == 0) ? null : new Match(cPtr, true);
  }

  public Match getMatchWithTolerances(String userAgent, int drift, int difference) {
    long cPtr = FiftyOneDegreesTrieV3JNI.Provider_getMatchWithTolerances__SWIG_0(swigCPtr, this, userAgent, drift, difference);
    return (cPtr == 0) ? null : new Match(cPtr, false);
  }

  public Match getMatchWithTolerances(MapStringString headers, int drift, int difference) {
    long cPtr = FiftyOneDegreesTrieV3JNI.Provider_getMatchWithTolerances__SWIG_1(swigCPtr, this, MapStringString.getCPtr(headers), headers, drift, difference);
    return (cPtr == 0) ? null : new Match(cPtr, false);
  }

  public String getMatchJson(String userAgent) {
    return FiftyOneDegreesTrieV3JNI.Provider_getMatchJson__SWIG_0(swigCPtr, this, userAgent);
  }

  public String getMatchJson(MapStringString headers) {
    return FiftyOneDegreesTrieV3JNI.Provider_getMatchJson__SWIG_1(swigCPtr, this, MapStringString.getCPtr(headers), headers);
  }

  public void setDrift(int drift) {
    FiftyOneDegreesTrieV3JNI.Provider_setDrift(swigCPtr, this, drift);
  }

  public void setDifference(int difference) {
    FiftyOneDegreesTrieV3JNI.Provider_setDifference(swigCPtr, this, difference);
  }

  public void reloadFromFile() {
    FiftyOneDegreesTrieV3JNI.Provider_reloadFromFile(swigCPtr, this);
  }

  public void reloadFromMemory(SWIGTYPE_p_unsigned_char source, int size) {
    FiftyOneDegreesTrieV3JNI.Provider_reloadFromMemory(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(source), size);
  }

  public boolean getIsThreadSafe() {
    return FiftyOneDegreesTrieV3JNI.Provider_getIsThreadSafe(swigCPtr, this);
  }

  public Provider(String fileName, String propertyString, boolean validate) {
    this(FiftyOneDegreesTrieV3JNI.new_Provider__SWIG_3(fileName, propertyString, validate), true);
  }

}
