builder.setComponentType(Common.Rep.OBJECT); boolean setComponentType = false; for (Object listElement : (List<?>) o) { if (!setComponentType) { if (Common.Rep.NULL != componentRep) { builder.setComponentType(componentRep); try { ResultSet rs = a.getResultSet(); builder.setComponentType(Common.Rep.OBJECT); boolean setComponentType = false; while (rs.next()) { if (!setComponentType) { if (Common.Rep.NULL != componentRep) { builder.setComponentType(componentRep);
builder.setComponentType(Common.Rep.OBJECT); boolean setComponentType = false; for (Object listElement : (List<?>) o) { if (!setComponentType) { if (Common.Rep.NULL != componentRep) { builder.setComponentType(componentRep); try { ResultSet rs = a.getResultSet(); builder.setComponentType(Common.Rep.OBJECT); boolean setComponentType = false; while (rs.next()) { if (!setComponentType) { if (Common.Rep.NULL != componentRep) { builder.setComponentType(componentRep);
/** * Creates a protocol buffer equivalent object for <code>this</code>. * @return A protobuf TypedValue equivalent for <code>this</code> */ public Common.TypedValue toProto() { final Common.TypedValue.Builder builder = Common.TypedValue.newBuilder(); // This isn't a static method, therefore we have a non-null TypedValue. Thus, this message // cannot be implicitly null builder.setImplicitlyNull(false); Common.Rep protoRep = type.toProto(); // Protobuf has an explicit BIG_DECIMAL representation enum value. if (Common.Rep.NUMBER == protoRep && value instanceof BigDecimal) { protoRep = Common.Rep.BIG_DECIMAL; } else if (Common.Rep.ARRAY == protoRep) { // This column value is an Array (many TypedValue's) builder.setType(Common.Rep.ARRAY); // Get the array component's type Common.Rep protoComponentRep = componentType.toProto(); // Set the array's component on the message builder.setComponentType(protoComponentRep); // Serialize that array into the builder @SuppressWarnings("unchecked") List<Object> list = (List<Object>) value; return serializeArray(list, builder, protoComponentRep); } // Serialize the type into the protobuf writeToProtoWithType(builder, value, protoRep); return builder.build(); }
/** * Creates a protocol buffer equivalent object for <code>this</code>. * @return A protobuf TypedValue equivalent for <code>this</code> */ public Common.TypedValue toProto() { final Common.TypedValue.Builder builder = Common.TypedValue.newBuilder(); // This isn't a static method, therefore we have a non-null TypedValue. Thus, this message // cannot be implicitly null builder.setImplicitlyNull(false); Common.Rep protoRep = type.toProto(); // Protobuf has an explicit BIG_DECIMAL representation enum value. if (Common.Rep.NUMBER == protoRep && value instanceof BigDecimal) { protoRep = Common.Rep.BIG_DECIMAL; } else if (Common.Rep.ARRAY == protoRep) { // This column value is an Array (many TypedValue's) builder.setType(Common.Rep.ARRAY); // Get the array component's type Common.Rep protoComponentRep = componentType.toProto(); // Set the array's component on the message builder.setComponentType(protoComponentRep); // Serialize that array into the builder @SuppressWarnings("unchecked") List<Object> list = (List<Object>) value; return serializeArray(list, builder, protoComponentRep); } // Serialize the type into the protobuf writeToProtoWithType(builder, value, protoRep); return builder.build(); }