public static Value struct(Type type, @Nullable Struct v) {
    if (v == null) {
      Preconditions.checkArgument(
          type.getCode() == Code.STRUCT,
          "Illegal call to create a NULL struct with a non-struct type.");
      return new StructImpl(type);
    } else {
      Preconditions.checkArgument(
          type.equals(v.getType()), "Mismatch between struct value and type.");
      return new StructImpl(v);
    }
  }
public static Value struct ( Type type , @ Nullable Struct v ) { if ( v == null ) { Preconditions . checkArgument ( type . getCode ( ) == Code . STRUCT , "Illegal call to create a NULL struct with a non-struct type." ) ; return new StructImpl ( type ) ; } else { Preconditions . checkArgument ( type . equals ( v . getType ( ) ) , "Mismatch between struct value and type." ) ; return new StructImpl ( v ) ; } }
Returns a {@code STRUCT} value of {@code Type} type.

@param type the type of the {@code STRUCT} value
@param v the struct {@code STRUCT} value. This may be {@code null} to produce a value for which
{@code isNull()} is {@code true}. If non-{@code null}, {@link Struct#getType()} must match
type.