public CreateEndpointResponse unmarshall(JsonUnmarshallerContext context) throws Exception { CreateEndpointResponse.Builder createEndpointResponseBuilder = CreateEndpointResponse.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 createEndpointResponseBuilder.build(); } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Endpoint", targetDepth)) { context.nextToken(); createEndpointResponseBuilder.endpoint(EndpointUnmarshaller.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 createEndpointResponseBuilder.build(); }
/** * <p> * The endpoint that was created. * </p> * This is a convenience that creates an instance of the {@link Endpoint.Builder} avoiding the need to create * one manually via {@link Endpoint#builder()}. * * When the {@link Consumer} completes, {@link Endpoint.Builder#build()} is called immediately and its result is * passed to {@link #endpoint(Endpoint)}. * * @param endpoint * a consumer that will call methods on {@link Endpoint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endpoint(Endpoint) */ default Builder endpoint(Consumer<Endpoint.Builder> endpoint) { return endpoint(Endpoint.builder().applyMutation(endpoint).build()); } }
/** * <p> * The endpoint that was created. * </p> * This is a convenience that creates an instance of the {@link Endpoint.Builder} avoiding the need to create * one manually via {@link Endpoint#builder()}. * * When the {@link Consumer} completes, {@link Endpoint.Builder#build()} is called immediately and its result is * passed to {@link #endpoint(Endpoint)}. * * @param endpoint * a consumer that will call methods on {@link Endpoint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endpoint(Endpoint) */ default Builder endpoint(Consumer<Endpoint.Builder> endpoint) { return endpoint(Endpoint.builder().applyMutation(endpoint).build()); } }
/** * <p> * The endpoint that was created. * </p> * This is a convenience that creates an instance of the {@link Endpoint.Builder} avoiding the need to create * one manually via {@link Endpoint#builder()}. * * When the {@link Consumer} completes, {@link Endpoint.Builder#build()} is called immediately and its result is * passed to {@link #endpoint(Endpoint)}. * * @param endpoint * a consumer that will call methods on {@link Endpoint.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #endpoint(Endpoint) */ default Builder endpoint(Consumer<Endpoint.Builder> endpoint) { return endpoint(Endpoint.builder().applyMutation(endpoint).build()); } }