| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | |
| 3 * Copyright (C) 2006-present eyeo GmbH | |
| 4 * | |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | |
| 6 * it under the terms of the GNU General Public License version 3 as | |
| 7 * published by the Free Software Foundation. | |
| 8 * | |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 12 * GNU General Public License for more details. | |
| 13 * | |
| 14 * You should have received a copy of the GNU General Public License | |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | |
| 16 */ | |
| 17 | |
| 18 package org.adblockplus.libadblockplus; | |
| 19 | |
| 20 public final class Subscription extends JsValue | |
| 21 { | |
| 22 static | |
| 23 { | |
| 24 System.loadLibrary("adblockplus-jni"); | |
| 25 registerNatives(); | |
| 26 } | |
| 27 | |
| 28 private Subscription(final long ptr) | |
| 29 { | |
| 30 super(ptr); | |
| 31 } | |
| 32 | |
| 33 public boolean isDisabled() | |
| 34 { | |
| 35 return isDisabled(this.ptr); | |
| 36 } | |
| 37 | |
| 38 public void setDisabled(boolean disabled) | |
| 39 { | |
| 40 setDisabled(this.ptr, disabled); | |
| 41 } | |
| 42 | |
| 43 public boolean isListed() | |
| 44 { | |
| 45 return isListed(this.ptr); | |
| 46 } | |
| 47 | |
| 48 public void addToList() | |
| 49 { | |
| 50 addToList(this.ptr); | |
| 51 } | |
| 52 | |
| 53 public void removeFromList() | |
| 54 { | |
| 55 removeFromList(this.ptr); | |
| 56 } | |
| 57 | |
| 58 public void updateFilters() | |
| 59 { | |
| 60 updateFilters(this.ptr); | |
| 61 } | |
| 62 | |
| 63 public boolean isUpdating() | |
| 64 { | |
| 65 return isUpdating(this.ptr); | |
| 66 } | |
| 67 | |
| 68 public boolean isAcceptableAds() | |
| 69 { | |
| 70 return isAcceptableAds(this.ptr); | |
| 71 } | |
| 72 | |
| 73 @Override | |
| 74 public int hashCode() | |
| 75 { | |
| 76 return (int)(this.ptr >> 32) * (int)this.ptr; | |
| 77 } | |
| 78 | |
| 79 @Override | |
| 80 public boolean equals(final Object o) | |
| 81 { | |
| 82 if (!(o instanceof Subscription)) | |
| 83 { | |
| 84 return false; | |
| 85 } | |
| 86 | |
| 87 return operatorEquals(this.ptr, ((Subscription)o).ptr); | |
| 88 } | |
| 89 | |
| 90 private final static native void registerNatives(); | |
| 91 | |
| 92 private final static native boolean isDisabled(long ptr); | |
| 93 | |
| 94 private final static native void setDisabled(long ptr, boolean disabled); | |
| 95 | |
| 96 private final static native boolean isListed(long ptr); | |
| 97 | |
| 98 private final static native void addToList(long ptr); | |
| 99 | |
| 100 private final static native void removeFromList(long ptr); | |
| 101 | |
| 102 private final static native void updateFilters(long ptr); | |
| 103 | |
| 104 private final static native boolean isUpdating(long ptr); | |
| 105 | |
| 106 private final static native boolean operatorEquals(long ptr, long other); | |
| 107 | |
| 108 private final static native boolean isAcceptableAds(long ptr); | |
| 109 } | |
| OLD | NEW |