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.http;
018
019/**
020 * A name/value pair representing a single query parameter, form field, or path variable.
021 *
022 * <p>
023 * Implementations may supply their value eagerly or lazily (via a {@link java.util.function.Supplier}).
024 * A {@code null} value signals that the part should be omitted from the request.
025 *
026 * <h5 class='section'>See Also:</h5><ul>
027 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/NextGenRestClient">Next-Generation REST Client</a>
028 * </ul>
029 *
030 * @since 9.2.1
031 */
032public interface HttpPart {
033
034   /**
035    * Returns the part name.
036    *
037    * @return The part name. Never <jk>null</jk>.
038    */
039   String getName();
040
041   /**
042    * Returns the part value, or <jk>null</jk> if the part should be omitted.
043    *
044    * @return The part value, possibly <jk>null</jk>.
045    */
046   String getValue();
047}