Tabnine Logo
ProtobufSystemInfo$Attribute.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo$Attribute

Best Java code snippets using org.sonar.process.systeminfo.protobuf.ProtobufSystemInfo$Attribute.getKey (Showing top 4 results out of 315)

origin: SonarSource/sonarqube

@CheckForNull
public static ProtobufSystemInfo.Attribute attribute(Section section, String key) {
 for (ProtobufSystemInfo.Attribute attribute : section.getAttributesList()) {
  if (attribute.getKey().equals(key)) {
   return attribute;
  }
 }
 return null;
}
origin: SonarSource/sonarqube

@Test
public void export_system_info() {
 ProtobufSystemInfo.Section section = underTest.toProtobuf();
 assertThat(section.getName()).isEqualTo("Compute Engine Database Connection");
 assertThat(section.getAttributesCount()).isEqualTo(9);
 assertThat(section.getAttributes(0).getKey()).isEqualTo("Pool Initial Size");
 assertThat(section.getAttributes(0).getLongValue()).isGreaterThanOrEqualTo(0);
}
origin: SonarSource/sonarqube

private void writeAttribute(ProtobufSystemInfo.Attribute attribute, JsonWriter json) {
 switch (attribute.getValueCase()) {
  case BOOLEAN_VALUE:
   json.prop(attribute.getKey(), attribute.getBooleanValue());
   break;
  case LONG_VALUE:
   json.prop(attribute.getKey(), attribute.getLongValue());
   break;
  case DOUBLE_VALUE:
   json.prop(attribute.getKey(), attribute.getDoubleValue());
   break;
  case STRING_VALUE:
   json.prop(attribute.getKey(), attribute.getStringValue());
   break;
  case VALUE_NOT_SET:
   json.name(attribute.getKey()).beginArray().values(attribute.getStringValuesList()).endArray();
   break;
  default:
   throw new IllegalArgumentException("Unsupported type: " + attribute.getValueCase());
 }
}
origin: org.sonarsource.sonarqube/sonar-server

private void writeAttribute(ProtobufSystemInfo.Attribute attribute, JsonWriter json) {
 switch (attribute.getValueCase()) {
  case BOOLEAN_VALUE:
   json.prop(attribute.getKey(), attribute.getBooleanValue());
   break;
  case LONG_VALUE:
   json.prop(attribute.getKey(), attribute.getLongValue());
   break;
  case DOUBLE_VALUE:
   json.prop(attribute.getKey(), attribute.getDoubleValue());
   break;
  case STRING_VALUE:
   json.prop(attribute.getKey(), attribute.getStringValue());
   break;
  case VALUE_NOT_SET:
   json.name(attribute.getKey()).beginArray().values(attribute.getStringValuesList()).endArray();
   break;
  default:
   throw new IllegalArgumentException("Unsupported type: " + attribute.getValueCase());
 }
}
org.sonar.process.systeminfo.protobufProtobufSystemInfo$AttributegetKey

Popular methods of ProtobufSystemInfo$Attribute

  • getLongValue
  • getBooleanValue
  • getStringValue
  • getDoubleValue
  • getStringValuesList
  • getValueCase
  • newBuilder

Popular in Java

  • Reading from database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top PhpStorm 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