001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.httppart;
018
019import org.apache.juneau.httppart.*;
020
021/**
022 * Represents the information needed to serialize a response part such as a response header or content.
023 *
024 * <h5 class='section'>See Also:</h5><ul>
025 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/HttpParts">HTTP Parts</a>
026 * </ul>
027 */
028public class ResponsePartMeta {
029
030   /**
031    * Represents a non-existent meta.
032    */
033   public static final ResponsePartMeta NULL = new ResponsePartMeta(null, null, null);
034
035   private final HttpPartType partType;
036   private final HttpPartSchema schema;
037   private final HttpPartSerializer serializer;
038
039   /**
040    * Constructor.
041    *
042    * @param partType The part type.
043    * @param schema The part schema.
044    * @param serializer The serializer to use to serialize the part.
045    */
046   public ResponsePartMeta(HttpPartType partType, HttpPartSchema schema, HttpPartSerializer serializer) {
047      this.partType = partType;
048      this.schema = schema;
049      this.serializer = serializer;
050   }
051
052   /**
053    * Returns the part type.
054    *
055    * @return The part type.
056    */
057   public HttpPartType getPartType() {
058      return partType;
059   }
060
061   /**
062    * Returns the part schema.
063    *
064    * @return The part schema.
065    */
066   public HttpPartSchema getSchema() {
067      return schema;
068   }
069
070   /**
071    * Returns the part serializer.
072    *
073    * @return The part serializer.
074    */
075   public HttpPartSerializer getSerializer() {
076      return serializer;
077   }
078}