Codota Logo
Struct.getBytesList
Code IndexAdd Codota 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)

  • 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 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

  • Creating JSON documents from java classes using gson
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • JCheckBox (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
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