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

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

Best Java code snippets using com.google.cloud.spanner.Struct.isNull (Showing top 20 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

@Test
public void bindBoolArrayEmpty() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toBoolArray(Arrays.<Boolean>asList()),
     Type.array(Type.bool()));
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBooleanList(0)).containsExactly();
}
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 bindBoolArray() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toBoolArray(asList(true, null, false)),
     Type.array(Type.bool()));
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBooleanList(0)).containsExactly(true, null, false).inOrder();
}
origin: googleapis/google-cloud-java

@Test
public void bindString() {
 Struct row = execute(Statement.newBuilder("SELECT @v").bind("v").to("abc"), Type.string());
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getString(0)).isEqualTo("abc");
}
origin: googleapis/google-cloud-java

@Test
public void bindStringArray() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toStringArray(asList("a", "b", null)),
     Type.array(Type.string()));
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getStringList(0)).containsExactly("a", "b", null).inOrder();
}
origin: googleapis/google-cloud-java

@Test
public void bindInt64Null() {
 Struct row = execute(Statement.newBuilder("SELECT @v").bind("v").to((Long) null), Type.int64());
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void bindStringNull() {
 Struct row =
   execute(Statement.newBuilder("SELECT @v").bind("v").to((String) null), Type.string());
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeBool() {
 write(baseInsert().set("BoolValue").to(true).build());
 Struct row = readLastRow("BoolValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBoolean(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeInt64Null() {
 write(baseInsert().set("Int64Value").to((Long) null).build());
 Struct row = readLastRow("Int64Value");
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void bindTimestampArrayNull() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toTimestampArray(null),
     Type.array(Type.timestamp()));
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void bindBoolArrayNull() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toBoolArray((boolean[]) null),
     Type.array(Type.bool()));
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeInt64ArrayNull() {
 write(baseInsert().set("Int64ArrayValue").toInt64Array((long[]) null).build());
 Struct row = readLastRow("Int64ArrayValue");
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeTimestampNull() {
 write(baseInsert().set("TimestampValue").to((Timestamp) null).build());
 Struct row = readLastRow("TimestampValue");
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeFloat64ArrayNull() {
 write(baseInsert().set("Float64ArrayValue").toFloat64Array((double[]) null).build());
 Struct row = readLastRow("Float64ArrayValue");
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeFloat64Null() {
 write(baseInsert().set("Float64Value").to((Double) null).build());
 Struct row = readLastRow("Float64Value");
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void bindInt64ArrayNull() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toInt64Array((long[]) null),
     Type.array(Type.int64()));
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void bindStringArrayNull() {
 Struct row =
   execute(
     Statement.newBuilder("SELECT @v").bind("v").toStringArray(null),
     Type.array(Type.string()));
 assertThat(row.isNull(0)).isTrue();
}
origin: googleapis/google-cloud-java

@Test
public void writeDateArray() {
 Date d1 = Date.parseDate("2016-09-18");
 Date d2 = Date.parseDate("2016-09-19");
 write(baseInsert().set("DateArrayValue").toDateArray(Arrays.asList(d1, null, d2)).build());
 Struct row = readLastRow("DateArrayValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getDateList(0)).containsExactly(d1, null, d2).inOrder();
}
origin: googleapis/google-cloud-java

@Test
public void writeInt64Array() {
 write(baseInsert().set("Int64ArrayValue").toInt64Array(Arrays.asList(1L, 2L, null)).build());
 Struct row = readLastRow("Int64ArrayValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getLongList(0)).containsExactly(1L, 2L, null).inOrder();
 expectedException.expect(NullPointerException.class);
 row.getLongArray(0);
}
origin: googleapis/google-cloud-java

@Test
public void writeBytes() {
 ByteArray data = ByteArray.copyFrom("V1");
 write(baseInsert().set("BytesValue").to(data).build());
 Struct row = readLastRow("BytesValue");
 assertThat(row.isNull(0)).isFalse();
 assertThat(row.getBytes(0)).isEqualTo(data);
}
com.google.cloud.spannerStructisNull

Popular methods of Struct

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

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
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