<commit_before>package com.github.toastshaman.dropwizard.auth.jwt.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;

import java.util.Map;

import static com.github.toastshaman.dropwizard.auth.jwt.JsonWebTokenAlgorithms.*;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Maps.newHashMap;
import static org.apache.commons.lang.StringUtils.isNotBlank;

public class JsonWebTokenHeader {

    private static final String JWT_HEADER = "JWT";

    @JsonProperty("typ")
    @NotEmpty
    private String typ;

    @JsonProperty("alg")
    @NotEmpty
    private String alg;

    private JsonWebTokenHeader() {
        // we need an empty constructor for the Jackson mapper
    }

    private JsonWebTokenHeader(String typ, String alg) {
        this.typ = typ;
        this.alg = alg;
    }

    public String getAlg() { return alg; }

    public String getTyp() { return typ; }

    public static class Builder {

        private String typ;

        private String alg;

        private Map<String, Object> params = newHashMap();

        public JsonWebTokenHeader build() {
            checkNotNull(alg);
            checkNotNull(typ);
            checkArgument(isNotBlank(alg));
            checkArgument(isNotBlank(typ));
            return new JsonWebTokenHeader(typ, alg);
        }

        public Builder alg(String alg) {
            checkNotNull(alg);
            checkArgument(isNotBlank(alg));
            this.alg = alg.toUpperCase();
            return this;
        }

        public Builder typ(String typ) {
            checkNotNull(typ);
            checkArgument(isNotBlank(typ));
            this.typ = typ.toUpperCase();
            return this;
        }
    }

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

    public static JsonWebTokenHeader HS256() { return new JsonWebTokenHeader(JWT_HEADER, HS256); }

    public static JsonWebTokenHeader H384() { return new JsonWebTokenHeader(JWT_HEADER, HS384); }

    public static JsonWebTokenHeader HS512() { return new JsonWebTokenHeader(JWT_HEADER, HS512); }
}<commit_msg>Typo in the method name for creating a header<commit_after>package com.github.toastshaman.dropwizard.auth.jwt.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.validator.constraints.NotEmpty;

import java.util.Map;

import static com.github.toastshaman.dropwizard.auth.jwt.JsonWebTokenAlgorithms.*;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.Maps.newHashMap;
import static org.apache.commons.lang.StringUtils.isNotBlank;

public class JsonWebTokenHeader {

    private static final String JWT_HEADER = "JWT";

    @JsonProperty("typ")
    @NotEmpty
    private String typ;

    @JsonProperty("alg")
    @NotEmpty
    private String alg;

    private JsonWebTokenHeader() {
        // we need an empty constructor for the Jackson mapper
    }

    private JsonWebTokenHeader(String typ, String alg) {
        this.typ = typ;
        this.alg = alg;
    }

    public String getAlg() { return alg; }

    public String getTyp() { return typ; }

    public static class Builder {

        private String typ;

        private String alg;

        private Map<String, Object> params = newHashMap();

        public JsonWebTokenHeader build() {
            checkNotNull(alg);
            checkNotNull(typ);
            checkArgument(isNotBlank(alg));
            checkArgument(isNotBlank(typ));
            return new JsonWebTokenHeader(typ, alg);
        }

        public Builder alg(String alg) {
            checkNotNull(alg);
            checkArgument(isNotBlank(alg));
            this.alg = alg.toUpperCase();
            return this;
        }

        public Builder typ(String typ) {
            checkNotNull(typ);
            checkArgument(isNotBlank(typ));
            this.typ = typ.toUpperCase();
            return this;
        }
    }

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

    public static JsonWebTokenHeader HS256() { return new JsonWebTokenHeader(JWT_HEADER, HS256); }

    public static JsonWebTokenHeader HS384() { return new JsonWebTokenHeader(JWT_HEADER, HS384); }

    public static JsonWebTokenHeader HS512() { return new JsonWebTokenHeader(JWT_HEADER, HS512); }
}
{'fraction_non_alphanumeric': 0.09177565949900243, 'fraction_numerical': 0.007980492130348038, 'mean_word_length': 2.846547314578005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5221416', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1228, 'n_words': 306}