public AdminGetDeviceResponse unmarshall(JsonUnmarshallerContext context) throws Exception { AdminGetDeviceResponse.Builder adminGetDeviceResponseBuilder = AdminGetDeviceResponse.builder(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return adminGetDeviceResponseBuilder.build(); } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Device", targetDepth)) { context.nextToken(); adminGetDeviceResponseBuilder.device(DeviceTypeUnmarshaller.getInstance().unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return adminGetDeviceResponseBuilder.build(); }
/** * <p> * The device. * </p> * This is a convenience that creates an instance of the {@link DeviceType.Builder} avoiding the need to create * one manually via {@link DeviceType#builder()}. * * When the {@link Consumer} completes, {@link DeviceType.Builder#build()} is called immediately and its result * is passed to {@link #device(DeviceType)}. * * @param device * a consumer that will call methods on {@link DeviceType.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #device(DeviceType) */ default Builder device(Consumer<DeviceType.Builder> device) { return device(DeviceType.builder().applyMutation(device).build()); } }
/** * <p> * The device. * </p> * This is a convenience that creates an instance of the {@link DeviceType.Builder} avoiding the need to create * one manually via {@link DeviceType#builder()}. * * When the {@link Consumer} completes, {@link DeviceType.Builder#build()} is called immediately and its result * is passed to {@link #device(DeviceType)}. * * @param device * a consumer that will call methods on {@link DeviceType.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #device(DeviceType) */ default Builder device(Consumer<DeviceType.Builder> device) { return device(DeviceType.builder().applyMutation(device).build()); } }