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.httppart;
014
015import org.apache.juneau.httppart.*;
016
017/**
018 * Represents the information needed to serialize a response part such as a response header or content.
019 *
020 * <h5 class='section'>See Also:</h5><ul>
021 *    <li class='link'><a class="doclink" href="../../../../../index.html#jrs.HttpParts">HTTP Parts</a>
022 * </ul>
023 */
024public class ResponsePartMeta {
025
026   /**
027    * Represents a non-existent meta.
028    */
029   public static final ResponsePartMeta NULL = new ResponsePartMeta(null, null, null);
030
031   private final HttpPartType partType;
032   private final HttpPartSchema schema;
033   private final HttpPartSerializer serializer;
034
035   /**
036    * Constructor.
037    *
038    * @param partType The part type.
039    * @param schema The part schema.
040    * @param serializer The serializer to use to serialize the part.
041    */
042   public ResponsePartMeta(HttpPartType partType, HttpPartSchema schema, HttpPartSerializer serializer) {
043      this.partType = partType;
044      this.schema = schema;
045      this.serializer = serializer;
046   }
047
048   /**
049    * Returns the part type.
050    *
051    * @return The part type.
052    */
053   public HttpPartType getPartType() {
054      return partType;
055   }
056
057   /**
058    * Returns the part schema.
059    *
060    * @return The part schema.
061    */
062   public HttpPartSchema getSchema() {
063      return schema;
064   }
065
066   /**
067    * Returns the part serializer.
068    *
069    * @return The part serializer.
070    */
071   public HttpPartSerializer getSerializer() {
072      return serializer;
073   }
074}