com.teststeps.thekla4j.http.spp.Authorization Maven / Gradle / Ivy
package com.teststeps.thekla4j.http.spp;
import java.util.function.Function;
public enum Authorization implements HttpHeaderValue {
BASIC(x -> "Basic " + x),
BEARER(x -> "Bearer " + x),;
private final Function headerFunc;
private String value;
public final String asString() {
return headerFunc.apply(value);
};
public Authorization of(String value) {
this.value = value;
return this;
}
private Authorization(Function f) {
this.headerFunc = f;
}
}