Tabnine Logo
Nullable.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
brave.internal.Nullable
constructor

Best Java code snippets using brave.internal.Nullable.<init> (Showing top 20 results out of 315)

origin: openzipkin/brave

/**
 * Sets the current span in scope until the returned object is closed. It is a programming error
 * to drop or never close the result. Using try-with-resources is preferred for this reason.
 *
 * @param currentSpan span to place into scope or null to clear the scope
 */
public abstract Scope newScope(@Nullable TraceContext currentSpan);
origin: openzipkin/brave

/**
 * The parent's {@link #spanId} or null if this the root span in a trace.
 *
 * @see #parentIdAsLong()
 */
@Nullable public final Long parentId() {
 return parentId != 0 ? parentId : null;
}
origin: openzipkin/brave

/**
 * The entire URL, including the scheme, host and query parameters if available or null if
 * unreadable.
 *
 * <p>Conventionally associated with the key "http.url"
 */
@Nullable public abstract String url(Req request);
origin: openzipkin/brave

/**
 * The HTTP status code or null if unreadable.
 *
 * <p>Conventionally associated with the key "http.status_code"
 *
 * @see #statusCodeAsInt(Object)
 */
@Nullable public abstract Integer statusCode(Resp response);
origin: openzipkin/brave

/**
 * Returns an overriding sampling decision for a new trace. Return null ignore the request and use
 * the {@link brave.sampler.Sampler trace ID sampler}.
 */
@Nullable public abstract <Req> Boolean trySample(HttpAdapter<Req, ?> adapter, Req request);
origin: openzipkin/brave

 /**
  * Customizes the span based on the response received from the server.
  *
  * <p>{@inheritDoc}
  */
 @Override public <Resp> void response(HttpAdapter<?, Resp> adapter, @Nullable Resp res,
   @Nullable Throwable error, SpanCustomizer customizer) {
  super.response(adapter, res, error, customizer);
 }
}
origin: openzipkin/brave

 /**
  * Customizes the span based on the response sent to the client.
  *
  * <p>{@inheritDoc}
  */
 @Override public <Resp> void response(HttpAdapter<?, Resp> adapter, @Nullable Resp res,
   @Nullable Throwable error, SpanCustomizer customizer) {
  super.response(adapter, res, error, customizer);
 }
}
origin: openzipkin/brave

 /**
  * Finishes the client span after assigning it tags according to the response or error.
  *
  * <p>This is typically called once the response headers are received, and after the span is
  * {@link brave.Tracer.SpanInScope#close() no longer in scope}.
  *
  * @see HttpClientParser#response(HttpAdapter, Object, Throwable, SpanCustomizer)
  */
 public void handleReceive(@Nullable Resp response, @Nullable Throwable error, Span span) {
  handleFinish(response, error, span);
 }
}
origin: openzipkin/brave

/** Returns the last value associated with the key or null */
@Nullable public String tag(String key) {
 if (key == null) throw new NullPointerException("key == null");
 if (key.isEmpty()) throw new IllegalArgumentException("key is empty");
 String result = null;
 for (int i = 0, length = tags.size(); i < length; i += 2) {
  if (key.equals(tags.get(i))) result = tags.get(i + 1);
 }
 return result;
}
origin: openzipkin/brave

/** @see TraceContext#sampled() */
public Builder sampled(@Nullable Boolean sampled) {
 if (sampled == null) {
  flags &= ~(FLAG_SAMPLED_SET | FLAG_SAMPLED);
  return this;
 }
 return sampled(sampled.booleanValue());
}
origin: openzipkin/brave

/**
 * The absolute http path, without any query parameters or null if unreadable. Ex.
 * "/objects/abcd-ff"
 *
 * <p>Conventionally associated with the key "http.path"
 * @see #route(Object)
 */
@Nullable public String path(Req request) {
 String url = url(request);
 if (url == null) return null;
 return URI.create(url).getPath(); // TODO benchmark
}
origin: openzipkin/brave

@Nullable public String linkLocalIp() {
 // uses synchronized variant of double-checked locking as getting the endpoint can be expensive
 if (linkLocalIp != null) return linkLocalIp;
 synchronized (this) {
  if (linkLocalIp == null) {
   linkLocalIp = produceLinkLocalIp();
  }
 }
 return linkLocalIp;
}
origin: openzipkin/brave

/** @see #localIp() */
public boolean localIp(@Nullable String localIp) {
 this.localIp = IpLiteral.ipOrNull(localIp);
 return true;
}
origin: openzipkin/brave

/** @see brave.Span#remoteIpAndPort(String, int) */
public boolean remoteIpAndPort(@Nullable String remoteIp, int remotePort) {
 if (remoteIp == null) return false;
 this.remoteIp = IpLiteral.ipOrNull(remoteIp);
 if (this.remoteIp == null) return false;
 if (remotePort > 0xffff) throw new IllegalArgumentException("invalid port " + remotePort);
 if (remotePort < 0) remotePort = 0;
 this.remotePort = remotePort;
 return true;
}
origin: openzipkin/brave

 @Override public Scope newScope(@Nullable TraceContext currentSpan) {
  Scope scope = delegate.newScope(currentSpan);
  return decorateScope(currentSpan, scope);
 }
}
origin: openzipkin/brave

 public SamplingFlags sample(@Nullable P parameters) {
  if (parameters == null) return SamplingFlags.EMPTY;
  for (Rule<P> rule : rules) {
   if (rule.matches(parameters)) return rule.isSampled();
  }
  return SamplingFlags.EMPTY;
 }
}
origin: openzipkin/brave

/**
 * Returns the value of the field with the specified key or null if not available.
 *
 * <p>Prefer {@link #get(TraceContext, String)} if you have a reference to a span.
 */
@Nullable public static String get(String name) {
 TraceContext context = currentTraceContext();
 return context != null ? get(context, name) : null;
}
origin: openzipkin/brave

 final void replace(String key, @Nullable String value) {
  if (value != null) {
   put(key, value);
  } else {
   remove(key);
  }
 }
}
origin: openzipkin/brave

 @Override public void onCompletion(RecordMetadata metadata, @Nullable Exception exception) {
  try (Scope ws = current.maybeScope(span.context())) {
   delegate.onCompletion(metadata, exception);
  } finally {
   super.onCompletion(metadata, exception);
  }
 }
}
origin: openzipkin/brave

/**
 * Returns the {@link Tracer#nextSpan(TraceContextOrSamplingFlags)} or null if {@link
 * #CURRENT_TRACER} and tracing isn't available.
 */
@Nullable public Span next(TraceContextOrSamplingFlags extracted) {
 Tracer tracer = tracer();
 if (tracer == null) return null;
 Span next = tracer.nextSpan(extracted);
 Object[] spanAndScope = {next, tracer.withSpanInScope(next)};
 getCurrentSpanInScopeStack().addFirst(spanAndScope);
 return next;
}
brave.internalNullable<init>

Popular methods of Nullable

    Popular in Java

    • Reactive rest calls using spring rest template
    • getSharedPreferences (Context)
    • onCreateOptionsMenu (Activity)
    • startActivity (Activity)
    • GridBagLayout (java.awt)
      The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
    • InputStreamReader (java.io)
      A class for turning a byte stream into a character stream. Data read from the source input stream is
    • String (java.lang)
    • BigDecimal (java.math)
      An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
    • ResourceBundle (java.util)
      ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
    • Runner (org.openjdk.jmh.runner)
    • Top Vim plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now