Codota Logo
Struct.getColumnCount
Code IndexAdd Codota to your IDE (free)

How to use
getColumnCount
method
in
com.google.cloud.spanner.Struct

Best Java code snippets using com.google.cloud.spanner.Struct.getColumnCount (Showing top 8 results out of 315)

  • Common ways to obtain Struct
private void myMethod () {
Struct s =
  • Codota IconResultSet resultSet;resultSet.getCurrentRowAsStruct()
  • Smart code suggestions by Codota
}
origin: googleapis/google-cloud-java

@Override
public int hashCode() {
 int result = getType().hashCode();
 for (int i = 0; i < getColumnCount(); ++i) {
  result = 31 * result + Objects.hashCode(getAsObject(i));
 }
 return result;
}
origin: googleapis/google-cloud-java

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (!(o instanceof Struct)) {
  return false;
 }
 Struct that = (Struct) o;
 if (!getType().equals(that.getType())) {
  return false;
 }
 for (int i = 0; i < getColumnCount(); ++i) {
  if (!Objects.equals(getAsObject(i), that.getAsObject(i))) {
   return false;
  }
 }
 return true;
}
origin: googleapis/google-cloud-java

 @Override
 com.google.protobuf.Value valueToProto() {
  checkNotNull();
  ListValue.Builder struct = ListValue.newBuilder();
  for (int fieldIndex = 0; fieldIndex < value.getColumnCount(); ++fieldIndex) {
   if (value.isNull(fieldIndex)) {
    struct.addValues(NULL_PROTO);
   } else {
    struct.addValues(getValue(fieldIndex).toProto());
   }
  }
  return com.google.protobuf.Value.newBuilder().setListValue(struct).build();
 }
}
origin: googleapis/google-cloud-java

private void assertRow(Struct actualRow, JSONArray expectedRow) throws Exception {
 assertThat(actualRow.getColumnCount()).isEqualTo(expectedRow.length());
 for (int i = 0; i < expectedRow.length(); i++) {
  switch (actualRow.getColumnType(i).getCode()) {
   case BOOL:
    assertThat(actualRow.getBoolean(i)).isEqualTo(expectedRow.getBoolean(i));
    break;
   case STRING:
    assertThat(actualRow.getString(i)).isEqualTo(expectedRow.getString(i));
    break;
   case INT64:
    assertThat(actualRow.getLong(i)).isEqualTo(expectedRow.getLong(i));
    break;
   case FLOAT64:
    assertThat(actualRow.getDouble(i)).isEqualTo(expectedRow.getDouble(i));
    break;
   case BYTES:
    assertThat(actualRow.getBytes(i))
      .isEqualTo(ByteArray.fromBase64(expectedRow.getString(i)));
    break;
   case ARRAY:
    Type elementType = actualRow.getColumnType(i).getArrayElementType();
    assertArray(getRawList(actualRow, i, elementType), expectedRow.getJSONArray(i));
    break;
   default:
    Assert.fail("Unexpected type code:" + actualRow.getColumnType(i).getCode());
  }
 }
}
origin: GoogleCloudPlatform/java-docs-samples

Struct row = c.element();
long sum = 0;
for (int i = 0; i < row.getColumnCount(); i++) {
 if (row.isNull(i)) {
  continue;
origin: com.google.cloud/google-cloud-spanner

@Override
public int hashCode() {
 int result = getType().hashCode();
 for (int i = 0; i < getColumnCount(); ++i) {
  result = 31 * result + Objects.hashCode(getAsObject(i));
 }
 return result;
}
origin: com.google.cloud/google-cloud-spanner

@Override
public boolean equals(Object o) {
 if (this == o) {
  return true;
 }
 if (!(o instanceof Struct)) {
  return false;
 }
 Struct that = (Struct) o;
 if (!getType().equals(that.getType())) {
  return false;
 }
 for (int i = 0; i < getColumnCount(); ++i) {
  if (!Objects.equals(getAsObject(i), that.getAsObject(i))) {
   return false;
  }
 }
 return true;
}
origin: com.google.cloud/google-cloud-spanner

 @Override
 com.google.protobuf.Value valueToProto() {
  checkNotNull();
  ListValue.Builder struct = ListValue.newBuilder();
  for (int fieldIndex = 0; fieldIndex < value.getColumnCount(); ++fieldIndex) {
   if (value.isNull(fieldIndex)) {
    struct.addValues(NULL_PROTO);
   } else {
    struct.addValues(getValue(fieldIndex).toProto());
   }
  }
  return com.google.protobuf.Value.newBuilder().setListValue(struct).build();
 }
}
com.google.cloud.spannerStructgetColumnCount

Popular methods of Struct

  • getString
  • getLong
  • getColumnType
  • isNull
  • getBoolean
  • getBytes
  • getType
  • newBuilder
    Returns a builder for creating a non- NULL Struct instance.
  • getBooleanArray
  • getBooleanList
  • getBytesList
  • getDate
  • getBytesList,
  • getDate,
  • getDateList,
  • getDouble,
  • getDoubleArray,
  • getDoubleList,
  • getLongArray,
  • getLongList,
  • getStringList

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now