CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 RSMSet.java 源代码,内容仅作参考
package org.jivesoftware.smackx.rsm.packet;
import org.jivesoftware.smack.packet.ExtensionElement;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.XmlStringBuilder;
public class RSMSet implements ExtensionElement {
public static final String ELEMENT = "set";
public static final String NAMESPACE = "http://jabber.org/protocol/rsm";
private final String after;
private final String before;
private final int count;
private final int firstIndex;
private final String firstString;
private final int index;
private final String last;
private final int max;
static class AnonymousClass1 {
static final int[] $SwitchMap$org$jivesoftware$smackx$rsm$packet$RSMSet$PageDirection;
static {
int[] iArr = new int[PageDirection.values().length];
$SwitchMap$org$jivesoftware$smackx$rsm$packet$RSMSet$PageDirection = iArr;
try {
iArr[PageDirection.before.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
$SwitchMap$org$jivesoftware$smackx$rsm$packet$RSMSet$PageDirection[PageDirection.after.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
}
}
public enum PageDirection {
before,
after
}
public RSMSet(int i10) {
this(i10, -1);
}
public static RSMSet from(Stanza stanza) {
return (RSMSet) stanza.getExtension(ELEMENT, NAMESPACE);
}
public static RSMSet newAfter(String str) {
return new RSMSet(str, PageDirection.after);
}
public static RSMSet newBefore(String str) {
return new RSMSet(str, PageDirection.before);
}
public String getAfter() {
return this.after;
}
public String getBefore() {
return this.before;
}
public int getCount() {
return this.count;
}
@Override
public String getElementName() {
return ELEMENT;
}
public String getFirst() {
return this.firstString;
}
public int getFirstIndex() {
return this.firstIndex;
}
public int getIndex() {
return this.index;
}
public String getLast() {
return this.last;
}
public int getMax() {
return this.max;
}
@Override
public String getNamespace() {
return NAMESPACE;
}
public RSMSet(int i10, int i11) {
this(null, null, -1, i11, null, i10, null, -1);
}
@Override
public XmlStringBuilder toXML() {
XmlStringBuilder xmlStringBuilder = new XmlStringBuilder((ExtensionElement) this);
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.optElement("after", this.after);
xmlStringBuilder.optElement("before", this.before);
xmlStringBuilder.optIntElement("count", this.count);
if (this.firstString != null) {
xmlStringBuilder.halfOpenElement("first");
xmlStringBuilder.optIntAttribute("index", this.firstIndex);
xmlStringBuilder.rightAngleBracket();
xmlStringBuilder.append((CharSequence) this.firstString);
xmlStringBuilder.closeElement("first");
}
xmlStringBuilder.optIntElement("index", this.index);
xmlStringBuilder.optElement("last", this.last);
xmlStringBuilder.optIntElement("max", this.max);
xmlStringBuilder.closeElement(this);
return xmlStringBuilder;
}
public RSMSet(String str, PageDirection pageDirection) {
this(-1, str, pageDirection);
}
public RSMSet(int i10, String str, PageDirection pageDirection) {
int i11 = AnonymousClass1.$SwitchMap$org$jivesoftware$smackx$rsm$packet$RSMSet$PageDirection[pageDirection.ordinal()];
if (i11 == 1) {
this.before = str;
this.after = null;
} else if (i11 == 2) {
this.before = null;
this.after = str;
} else {
throw new AssertionError();
}
this.count = -1;
this.index = -1;
this.last = null;
this.max = i10;
this.firstString = null;
this.firstIndex = -1;
}
public RSMSet(String str, String str2, int i10, int i11, String str3, int i12, String str4, int i13) {
this.after = str;
this.before = str2;
this.count = i10;
this.index = i11;
this.last = str3;
this.max = i12;
this.firstString = str4;
this.firstIndex = i13;
}
}