
org.catools.ws.model.CResponseHeaders Maven / Gradle / Ivy
package org.catools.ws.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.catools.common.collections.CList;
import org.catools.common.text.CStringUtil;
import java.util.stream.Stream;
public class CResponseHeaders extends CList {
public CResponseHeaders() {
}
public CResponseHeaders(CResponseHeader... c) {
super(c);
}
public CResponseHeaders(Stream stream) {
super(stream);
}
public CResponseHeaders(Iterable iterable) {
super(iterable);
}
@JsonIgnore
public String getValue(String name) {
CResponseHeader firstOrNull = getFirstOrNull(h -> CStringUtil.equalsIgnoreCase(name, h.Name.getValue()));
if (firstOrNull == null) {
return "";
}
return firstOrNull.Value.getValue();
}
@JsonIgnore
public CResponseHeader getHeader(String name) {
return getFirstOrNull(h -> CStringUtil.equalsIgnoreCase(name, h.Name.getValue()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy