001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.rest.client.remote; 014 015import static org.apache.juneau.internal.ClassUtils.*; 016 017import org.apache.juneau.http.annotation.*; 018import org.apache.juneau.httppart.*; 019import org.apache.juneau.httppart.bean.*; 020 021/** 022 * Represents the metadata about an {@link Response}-annotated return type on a method on a REST proxy class. 023 * 024 * <h5 class='section'>See Also:</h5> 025 * <ul class='doctree'> 026 * <li class='link'>{@doc juneau-rest-client.RestProxies} 027 * </ul> 028 */ 029public final class RemoteMethodBeanReturn { 030 031 private final ResponseBeanMeta meta; 032 private final HttpPartParser parser; 033 034 RemoteMethodBeanReturn(Class<? extends HttpPartParser> parser, ResponseBeanMeta meta) { 035 this.parser = newInstance(HttpPartParser.class, parser); 036 this.meta = meta; 037 } 038 039 /** 040 * Returns the parser to use for parsing parts on the response bean. 041 * 042 * @return The parser to use for parsing parts on the response bean, or <jk>null</jk> if not defined. 043 */ 044 public HttpPartParser getParser() { 045 return parser; 046 } 047 048 /** 049 * Returns metadata on the response bean. 050 * 051 * @return Metadata about the bean. 052 */ 053 public ResponseBeanMeta getMeta() { 054 return meta; 055 } 056}