com.logicommerce.sdk.builders.CookieBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk Show documentation
Show all versions of sdk Show documentation
SDK for developing Logicommerce plugins.
The newest version!
package com.logicommerce.sdk.builders;
import com.logicommerce.sdk.models.Cookie;
import com.logicommerce.sdk.models.implementations.CookieImpl;
public class CookieBuilder {
private String name;
private String value;
private int ttl = 1000;
private boolean secure = false;
private boolean httpOnly = true;
public CookieBuilder() {
//
}
/**
* Setter for the field name
.
*
* @param name a boolean
*/
public void name(String name) {
this.name = name;
}
/**
* Setter for the field value
.
*
* @param value a boolean
*/
public void value(String value) {
this.value = value;
}
/**
* Setter for the field ttl
.
*
* @param ttl a boolean
*/
public void ttl(int ttl) {
this.ttl = ttl;
}
/**
* Setter for the field secure
.
*
* @param secure a boolean
*/
public void secure(boolean secure) {
this.secure = secure;
}
/**
* Setter for the field httpOnly
.
*
* @param httpOnly a boolean
*/
public void httpOnly(boolean httpOnly) {
this.httpOnly = httpOnly;
}
/**
* build.
*
* @return a {@link com.logicommerce.sdk.models.Cookie} object
*/
public Cookie build() {
CookieImpl cookie = new CookieImpl();
cookie.setName(name);
cookie.setSecure(secure);
cookie.setValue(value);
cookie.setHttpOnly(httpOnly);
cookie.setTtl(ttl);
return cookie;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy