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

io.castle.client.model.CastleHeaders Maven / Gradle / Ivy

Go to download

Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users on potential account hijacks.

There is a newer version: 2.4.3
Show newest version
package io.castle.client.model;

import java.util.ArrayList;
import java.util.List;

public class CastleHeaders {

    private List headers;

    public List getHeaders() {
        return headers;
    }

    public static Builder builder() {
        return new Builder(new CastleHeaders());
    }

    public void setHeaders(List headers) {
        this.headers = headers;
    }

    @Override
    public String toString() {
        return "CastleHeaders{" +
                "headers=" + headers +
                '}';
    }

    public static class Builder {
        private CastleHeaders headers;
        private ArrayList headerList;

        public Builder(CastleHeaders headers) {
            this.headers = headers;
            this.headerList = new ArrayList<>();
        }

        public CastleHeaders build() {
            headers.setHeaders(headerList);
            return headers;
        }

        public Builder add(String key, String value) {
            this.headerList.add(new CastleHeader(key, value));
            return self();
        }

        private Builder self() {
            return this;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy