com.github.bloodshura.sparkium.mail.guerrilla.Cookies Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sparkium-mail Show documentation
Show all versions of sparkium-mail Show documentation
An API which aims to facilitate the usage of javax.mail, also including other mailing services.
The newest version!
package com.github.bloodshura.sparkium.mail.guerrilla;
import com.github.bloodshura.ignitium.charset.TextBuilder;
import com.github.bloodshura.ignitium.object.Base;
import com.github.bloodshura.ignitium.object.Mutable;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Mutable
public class Cookies extends Base {
private String phpSessId;
private String subscr;
@Nonnull
public String build() {
TextBuilder builder = new TextBuilder().setSeparator("; ");
if (hasPhpSessId()) {
builder.append("PHPSESSID=" + getPhpSessId());
}
if (hasSubscr()) {
builder.append("SUBSCR=" + getSubscr());
}
return builder.toString();
}
@Nullable
public String getPhpSessId() {
return phpSessId;
}
@Nullable
public String getSubscr() {
return subscr;
}
public boolean hasPhpSessId() {
return getPhpSessId() != null;
}
public boolean hasSubscr() {
return getSubscr() != null;
}
public void setPhpSessId(@Nullable String phpSessId) {
this.phpSessId = phpSessId;
}
public void setSubscr(@Nullable String subscr) {
this.subscr = subscr;
}
@Nonnull
@Override
protected Object[] stringValues() {
return new Object[] { getPhpSessId(), getSubscr() };
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy