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 018 package 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 ***/ 040 041 public final class POP3MessageInfo 042 { 043 public int number; 044 public int size; 045 public String identifier; 046 047 /*** 048 * Creates a POP3MessageInfo instance with <code>number</code> and 049 * <code> size </code> set to 0, and <code>identifier</code> set to 050 * null. 051 ***/ 052 public POP3MessageInfo() 053 { 054 this(0, null, 0); 055 } 056 057 /*** 058 * Creates a POP3MessageInfo instance with <code>number</code> set 059 * to <code> num </code>, <code> size </code> set to <code> octets </code>, 060 * and <code>identifier</code> set to null. 061 ***/ 062 public POP3MessageInfo(int num, int octets) 063 { 064 this(num, null, octets); 065 } 066 067 /*** 068 * Creates a POP3MessageInfo instance with <code>number</code> set 069 * to <code> num </code>, <code> size </code> undefined, 070 * and <code>identifier</code> set to <code>uid</code>. 071 ***/ 072 public POP3MessageInfo(int num, String uid) 073 { 074 this(num, uid, -1); 075 } 076 077 private POP3MessageInfo(int num, String uid, int size) { 078 this.number = num; 079 this.size = size; 080 this.identifier = uid; 081 } 082 }