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 */
017
018package org.apache.commons.net.pop3;
019
020/***
021 * POP3MessageInfo is used to return information about messages stored on
022 * a POP3 server.  Its fields are used to mean slightly different things
023 * depending on the information being returned.
024 * <p>
025 * In response to a status command, <code> number </code>
026 * contains the number of messages in the mailbox, <code> size </code>
027 * contains the size of the mailbox in bytes, and <code> identifier </code>
028 * is null.
029 * <p>
030 * In response to a message listings, <code> number </code>
031 * contains the message number, <code> size </code> contains the
032 * size of the message in bytes, and <code> identifier </code> is null.
033 * <p>
034 * In response to unique identifier listings, <code> number </code> contains
035 * the message number, <code> size </code> is undefined, and
036 * <code> identifier </code> contains the message's unique identifier.
037 * <p>
038 * <p>
039 * @author Daniel F. Savarese
040 ***/
041
042public final class POP3MessageInfo
043{
044    public int number;
045    public int size;
046    public String identifier;
047
048    /***
049     * Creates a POP3MessageInfo instance with <code>number</code> and
050     * <code> size </code> set to 0, and <code>identifier</code> set to
051     * null.
052     ***/
053    public POP3MessageInfo()
054    {
055        number = size = 0;
056        identifier = null;
057    }
058
059    /***
060     * Creates a POP3MessageInfo instance with <code>number</code> set
061     * to <code> num </code>, <code> size </code> set to <code> octets </code>,
062     * and <code>identifier</code> set to null.
063     ***/
064    public POP3MessageInfo(int num, int octets)
065    {
066        number = num;
067        size = octets;
068        identifier = null;
069    }
070
071    /***
072     * Creates a POP3MessageInfo instance with <code>number</code> set
073     * to <code> num </code>, <code> size </code> undefined,
074     * and <code>identifier</code> set to <code>uid</code>.
075     ***/
076    public POP3MessageInfo(int num, String uid)
077    {
078        number = num;
079        size = -1;
080        identifier = uid;
081    }
082}