All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dreamhead.moco.cookie.MaxAgeCookieAttribute Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
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));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy