/** Replaces the value of the field with the specified key, ignoring if not a permitted field */ public static void put(TraceContext context, String name, String value, Class<? extends PropagationFields> type) { if (context == null) throw new NullPointerException("context == null"); if (name == null) throw new NullPointerException("name == null"); if (value == null) throw new NullPointerException("value == null"); PropagationFields fields = context.findExtra(type); if (fields == null) return; fields.put(name, value); } }
/** Sets the value of the field with the specified key, or drops if not a configured field */ public static void set(TraceContext context, String name, String value) { PropagationFields.put(context, lowercase(name), value, Extra.class); }
/** Replaces the value of the field with the specified key, ignoring if not a permitted field */ public static void put(TraceContext context, String name, String value, Class<? extends PropagationFields> type) { if (context == null) throw new NullPointerException("context == null"); if (name == null) throw new NullPointerException("name == null"); if (value == null) throw new NullPointerException("value == null"); PropagationFields fields = context.findExtra(type); if (fields == null) return; fields.put(name, value); } }
/** Sets the value of the field with the specified key, or drops if not a configured field */ public static void set(TraceContext context, String name, String value) { PropagationFields.put(context, lowercase(name), value, Extra.class); }