com.github.dreamhead.moco.cookie.MaxAgeCookieAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.cookie;
import io.netty.handler.codec.http.cookie.Cookie;
import java.util.concurrent.TimeUnit;
public final class MaxAgeCookieAttribute extends ActualCookieAttribute {
private final long maxAge;
private final TimeUnit unit;
public MaxAgeCookieAttribute(final long actualMaxAge, final TimeUnit actualUnit) {
this.maxAge = actualMaxAge;
this.unit = actualUnit;
}
@Override
public final void visit(final Cookie cookie) {
cookie.setMaxAge(unit.toSeconds(maxAge));
}
}