// 
// Decompiled by Procyon v0.6.0
// 

package io.sentry;

import org.jetbrains.annotations.Nullable;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.ApiStatus;

@ApiStatus.Experimental
public final class BaggageHeader
{
    @NotNull
    public static final String BAGGAGE_HEADER = "baggage";
    @NotNull
    private final String value;
    
    @Nullable
    public static BaggageHeader fromBaggageAndOutgoingHeader(@NotNull final Baggage baggage, @Nullable final List<String> outgoingBaggageHeaders) {
        final Baggage thirdPartyBaggage = Baggage.fromHeader(outgoingBaggageHeaders, true, baggage.logger);
        final String headerValue = baggage.toHeaderString(thirdPartyBaggage.getThirdPartyHeader());
        if (headerValue.isEmpty()) {
            return null;
        }
        return new BaggageHeader(headerValue);
    }
    
    public BaggageHeader(@NotNull final String value) {
        this.value = value;
    }
    
    @NotNull
    public String getName() {
        return "baggage";
    }
    
    @NotNull
    public String getValue() {
        return this.value;
    }
}
