Tabnine Logo
Struct.getBytesList
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: googleapis/google-cloud-java

@Override
public List<ByteArray> getBytesList(String columnName) {
 return getCurrentRowAsStruct().getBytesList(columnName);
}
origin: googleapis/google-cloud-java

@Override
public List<ByteArray> getBytesList(int columnIndex) {
 return getCurrentRowAsStruct().getBytesList(columnIndex);
}
origin: googleapis/google-cloud-java

@Test
public void bindBytesArrayEmpty() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toBytesArray(Arrays.<ByteArray>asList()),
     Type.array(Type.bytes()));
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBytesList(0)).isEmpty();
}
origin: googleapis/google-cloud-java

@Test
public void writeBytesArrayEmpty() {
 write(baseInsert().set("BytesArrayValue").toBytesArray(Arrays.<ByteArray>asList()).build());
 Struct row = readLastRow("BytesArrayValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBytesList(0)).containsExactly();
}
origin: googleapis/google-cloud-java

@Test
public void writeBytesArray() {
 List<ByteArray> data = Arrays.asList(ByteArray.copyFrom("a"), ByteArray.copyFrom("b"), null);
 write(baseInsert().set("BytesArrayValue").toBytesArray(data).build());
 Struct row = readLastRow("BytesArrayValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBytesList(0)).isEqualTo(data);
}
origin: googleapis/google-cloud-java

@Test
public void bindBytesArray() {
 ByteArray e1 = ByteArray.copyFrom("x");
 ByteArray e2 = ByteArray.copyFrom("y");
 ByteArray e3 = null;
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toBytesArray(asList(e1, e2, e3)),
     Type.array(Type.bytes()));
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBytesList(0)).containsExactly(e1, e2, e3).inOrder();
}
origin: googleapis/google-cloud-java

private List<?> getRawList(Struct actualRow, int index, Type elementType) throws Exception {
 List<?> rawList = null;
 switch (elementType.getCode()) {
  case BOOL:
   rawList = actualRow.getBooleanList(index);
   break;
  case STRING:
   rawList = actualRow.getStringList(index);
   break;
  case BYTES:
   rawList = actualRow.getBytesList(index);
   break;
  case INT64:
   rawList = actualRow.getLongList(index);
   break;
  case FLOAT64:
   rawList = actualRow.getDoubleList(index);
   break;
  case STRUCT:
   rawList = actualRow.getStructList(index);
   break;
  default:
   Assert.fail("Unexpected type code:" + elementType.getCode());
 }
 return rawList;
}
origin: googleapis/google-cloud-java

 return Value.stringArray(value.getStringList(fieldIndex));
case BYTES:
 return Value.bytesArray(value.getBytesList(fieldIndex));
case FLOAT64:
 return Value.float64Array(value.getDoubleArray(fieldIndex));
origin: com.google.cloud/google-cloud-spanner

@Override
public List<ByteArray> getBytesList(int columnIndex) {
 return getCurrentRowAsStruct().getBytesList(columnIndex);
}
origin: com.google.cloud/google-cloud-spanner

@Override
public List<ByteArray> getBytesList(String columnName) {
 return getCurrentRowAsStruct().getBytesList(columnName);
}
origin: GoogleCloudPlatform/DataflowTemplates

return GSON.toJson(
  currentRow
    .getBytesList(columnName)
    .stream()
    .map(byteArray -> Base64.getEncoder().encodeToString(byteArray.toByteArray()))
origin: GoogleCloudPlatform/DataflowTemplates

if (!nullValue) {
 value =
   row.getBytesList(fieldName)
     .stream()
     .map(
origin: com.google.cloud/google-cloud-spanner

 return Value.stringArray(value.getStringList(fieldIndex));
case BYTES:
 return Value.bytesArray(value.getBytesList(fieldIndex));
case FLOAT64:
 return Value.float64Array(value.getDoubleArray(fieldIndex));
com.google.cloud.spannerStructgetBytesList

Popular methods of Struct

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

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JFileChooser (javax.swing)
  • Option (scala)
  • 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