TraceContextOrSamplingFlags { public static Builder newBuilder(TraceContext context) { if (context == null) throw new NullPointerException("context == null"); return new Builder(1, context, context.extra()); } TraceContextOrSamplingFlags(int type, SamplingFlags value, List<Object> extraList); static TraceContextOrSamplingFlags create(TraceContext context); static TraceContextOrSamplingFlags create(TraceIdContext traceIdContext); static TraceContextOrSamplingFlags create(SamplingFlags flags); static Builder newBuilder(TraceContext context); static Builder newBuilder(TraceIdContext traceIdContext); static Builder newBuilder(SamplingFlags flags); @Deprecated static Builder newBuilder(); @Nullable Boolean sampled(); final boolean sampledLocal(); @Deprecated TraceContextOrSamplingFlags sampled(@Nullable Boolean sampled); TraceContextOrSamplingFlags sampled(boolean sampled); @Nullable TraceContext context(); @Nullable TraceIdContext traceIdContext(); @Nullable SamplingFlags samplingFlags(); final List<Object> extra(); Builder toBuilder(); @Override String toString(); @Deprecated static TraceContextOrSamplingFlags create(@Nullable Boolean sampled, boolean debug); @Override boolean equals(Object o); @Override int hashCode(); static final TraceContextOrSamplingFlags EMPTY; }
@Deprecated @Test public void deprecated_builder_invalid() { TraceContextOrSamplingFlags.Builder builder = TraceContextOrSamplingFlags.newBuilder(); assertThatThrownBy(builder::build) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Value unset. Use a non-deprecated newBuilder method instead."); }