/** * Adds a prefix when fields are extracted or injected from headers. For example, if the prefix * is "baggage-", the field "country-code" would end up as "baggage-country-code" on the wire. * * <p>Note: any {@code fieldNames} will be implicitly lower-cased. */ public FactoryBuilder addPrefixedFields(String prefix, Collection<String> fieldNames) { if (prefix == null) throw new NullPointerException("prefix == null"); if (prefix.isEmpty()) throw new IllegalArgumentException("prefix is empty"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); prefixedNames.put(prefix, ensureLowerCase(new LinkedHashSet<>(fieldNames))); return this; }
/** Wraps an underlying propagation implementation, pushing one or more fields */ public static Factory newFactory(Propagation.Factory delegate, Collection<String> fieldNames) { if (delegate == null) throw new NullPointerException("delegate == null"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); String[] validated = ensureLowerCase(new LinkedHashSet<>(fieldNames)); return new Factory(delegate, validated, validated); }
/** Wraps an underlying propagation implementation, pushing one or more fields */ public static Factory newFactory(Propagation.Factory delegate, String... fieldNames) { if (delegate == null) throw new NullPointerException("delegate == null"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); String[] validated = ensureLowerCase(new LinkedHashSet<>(Arrays.asList(fieldNames))); return new Factory(delegate, validated, validated); }
public Factory build() { if (prefixedNames.isEmpty()) { String[] validated = ensureLowerCase(fieldNames); return new Factory(delegate, validated, validated); List<Integer> keyToFieldList = new ArrayList<>(); if (!fieldNames.isEmpty()) { List<String> validated = Arrays.asList(ensureLowerCase(fieldNames)); for (int i = 0, length = validated.size(); i < length; i++) { String nextFieldName = validated.get(i);
/** * Adds a prefix when fields are extracted or injected from headers. For example, if the prefix * is "baggage-", the field "country-code" would end up as "baggage-country-code" on the wire. * * <p>Note: any {@code fieldNames} will be implicitly lower-cased. */ public FactoryBuilder addPrefixedFields(String prefix, Collection<String> fieldNames) { if (prefix == null) throw new NullPointerException("prefix == null"); if (prefix.isEmpty()) throw new IllegalArgumentException("prefix is empty"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); prefixedNames.put(prefix, ensureLowerCase(new LinkedHashSet<>(fieldNames))); return this; }
/** Wraps an underlying propagation implementation, pushing one or more fields */ public static Factory newFactory(Propagation.Factory delegate, Collection<String> fieldNames) { if (delegate == null) throw new NullPointerException("delegate == null"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); String[] validated = ensureLowerCase(new LinkedHashSet<>(fieldNames)); return new Factory(delegate, validated, validated); }
/** Wraps an underlying propagation implementation, pushing one or more fields */ public static Factory newFactory(Propagation.Factory delegate, String... fieldNames) { if (delegate == null) throw new NullPointerException("delegate == null"); if (fieldNames == null) throw new NullPointerException("fieldNames == null"); String[] validated = ensureLowerCase(new LinkedHashSet<>(Arrays.asList(fieldNames))); return new Factory(delegate, validated, validated); }
public Factory build() { if (prefixedNames.isEmpty()) { String[] validated = ensureLowerCase(fieldNames); return new Factory(delegate, validated, validated); List<Integer> keyToFieldList = new ArrayList<>(); if (!fieldNames.isEmpty()) { List<String> validated = Arrays.asList(ensureLowerCase(fieldNames)); for (int i = 0, length = validated.size(); i < length; i++) { String nextFieldName = validated.get(i);