jdash.client.response.PrivateMessageDownloadResponseDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdash-client Show documentation
Show all versions of jdash-client Show documentation
The HTTP client used to pull data from Geometry Dash servers
The newest version!
package jdash.client.response;
import jdash.client.exception.ActionFailedException;
import jdash.common.entity.GDPrivateMessageDownload;
import java.util.function.Function;
import static jdash.common.RobTopsWeakEncryption.decodePrivateMessageBody;
import static jdash.common.internal.Indexes.MESSAGE_BODY;
import static jdash.common.internal.InternalUtils.*;
class PrivateMessageDownloadResponseDeserializer implements Function {
@Override
public GDPrivateMessageDownload apply(String response) {
ActionFailedException.throwIfEquals(response, "-1", "Failed to download message");
final var data = splitToMap(response, ":");
requireKeys(data, MESSAGE_BODY);
return new GDPrivateMessageDownload(buildMessage(data), decodePrivateMessageBody(data.get(MESSAGE_BODY)));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy