Class NullableArrayUtils

java.lang.Object
com.apple.foundationdb.relational.util.NullableArrayUtils

@API(EXPERIMENTAL) public final class NullableArrayUtils extends Object
A Utils class that holds logic related to nullable arrays. Nullable Arrays are arrays that, if unset, will be NULL. Non-nullable arrays are arrays that, if unset, will be empty list.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
     
    static boolean
    Returns whether the given descriptor represents a wrapped ARRAY, that is, whether it contains a single repeated field named values.
    static boolean
     
    static com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression
    wrapArray(com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression keyExpression, com.apple.foundationdb.record.query.plan.cascades.typing.Type.Record record, boolean containsNullableArray)
    Adds the wrapped array structure for any nullable arrays referenced in the given key expression (if the schema contains any such arrays).
    static com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression
    wrapArray(com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression keyExpression, Descriptors.Descriptor parentDescriptor, boolean containsNullableArray)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getRepeatedFieldName

      public static String getRepeatedFieldName()
    • isWrappedArrayDescriptor

      public static boolean isWrappedArrayDescriptor(String fieldName, Descriptors.Descriptor parentDescriptor)
    • isWrappedArrayDescriptor

      public static boolean isWrappedArrayDescriptor(@Nonnull Descriptors.Descriptor descriptor)
      Returns whether the given descriptor represents a wrapped ARRAY, that is, whether it contains a single repeated field named values.
    • wrapArray

      public static com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression wrapArray(com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression keyExpression, com.apple.foundationdb.record.query.plan.cascades.typing.Type.Record record, boolean containsNullableArray)
      Adds the wrapped array structure for any nullable arrays referenced in the given key expression (if the schema contains any such arrays).

      For example, reviews.rating will change to reviews.values.rating.

      Parameters:
      keyExpression - The key expression to modify.
      record - The record of the table.
      containsNullableArray - true if nullable arrays are to be found, otherwise false.
      Returns:
      modified key expression where any nullable array is wrapped.
    • wrapArray

      public static com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression wrapArray(com.apple.foundationdb.record.expressions.RecordKeyExpressionProto.KeyExpression keyExpression, Descriptors.Descriptor parentDescriptor, boolean containsNullableArray)