Tabnine Logo
UserAgent$Agent.of
Code IndexAdd Tabnine to your IDE (free)

How to use
of
method
in
com.palantir.remoting3.clients.UserAgent$Agent

Best Java code snippets using com.palantir.remoting3.clients.UserAgent$Agent.of (Showing top 2 results out of 315)

origin: com.palantir.remoting3/okhttp-clients

/**
 * Adds informational {@link com.palantir.remoting3.clients.UserAgent.Agent}s to the given {@link UserAgent}, one
 * for the http-remoting library and one for the given service class. Version strings are extracted from the
 * packages' {@link Package#getImplementationVersion implementation version}, defaulting to 0.0.0 if no version can
 * be found.
 */
private static UserAgent augmentUserAgent(UserAgent agent, Class<?> serviceClass) {
  UserAgent augmentedAgent = agent;
  String maybeServiceVersion = serviceClass.getPackage().getImplementationVersion();
  augmentedAgent = augmentedAgent.addAgent(UserAgent.Agent.of(
      serviceClass.getSimpleName(),
      maybeServiceVersion != null ? maybeServiceVersion : "0.0.0"));
  String maybeRemotingVersion = OkHttpClients.class.getPackage().getImplementationVersion();
  augmentedAgent = augmentedAgent.addAgent(UserAgent.Agent.of(
      UserAgents.REMOTING_AGENT_NAME,
      maybeRemotingVersion != null ? maybeRemotingVersion : "0.0.0"));
  return augmentedAgent;
}
origin: com.palantir.remoting3/http-clients

  builder.primary(UserAgent.Agent.of(name, version));
  comments.ifPresent(c -> {
    Map<String, String> parsedComments = parseComments(c);
} else {
  builder.addInformational(UserAgent.Agent.of(name, version));
  log.debug("Invalid user agent, falling back to default/unknown agent",
      SafeArg.of("userAgent", userAgent));
  return builder.primary(UserAgent.Agent.of("unknown", UserAgent.Agent.DEFAULT_VERSION)).build();
} else {
  throw new IllegalArgumentException("Failed to parse user agent string: " + userAgent);
com.palantir.remoting3.clientsUserAgent$Agentof

Popular methods of UserAgent$Agent

  • name
  • version

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Collectors (java.util.stream)
  • JFrame (javax.swing)
  • Top plugins for Android Studio
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