TraceContextOrSamplingFlags { public static TraceContextOrSamplingFlags create(TraceContext context) { return new TraceContextOrSamplingFlags(1, context, emptyList()); } 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; }
@Test public void equalsAndHashCode_samplingFlags() { equalsAndHashCode( () -> TraceContextOrSamplingFlags.create(SAMPLED), () -> TraceContextOrSamplingFlags.create(NOT_SAMPLED), () -> TraceContextOrSamplingFlags.create(context) ); }