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 * https://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.nntp; 019 020/** 021 * A placeholder interface for threadable message objects. 022 * 023 * @param <T> The Threadable implementation. 024 */ 025public interface Threadable<T extends Threadable<T>> { 026 027 /** 028 * Tests whether this is a dummy instance. 029 * 030 * @return whether this is a dummy instance. 031 */ 032 boolean isDummy(); 033 034 /** 035 * Creates a dummy instance. 036 * 037 * @return a dummy instance. 038 */ 039 T makeDummy(); 040 041 /** 042 * Gets an ID. 043 * 044 * @return an ID. 045 */ 046 String messageThreadId(); 047 048 /** 049 * Gets reference strings. 050 * 051 * @return reference strings. 052 */ 053 String[] messageThreadReferences(); 054 055 /** 056 * Sets the child instance. 057 * 058 * @param child the child instance. 059 */ 060 void setChild(T child); 061 062 /** 063 * Sets the next instance. 064 * 065 * @param next the next instance. 066 */ 067 void setNext(T next); 068 069 /** 070 * Gets the simplified subject. 071 * 072 * @return the simplified subject. 073 */ 074 String simplifiedSubject(); 075 076 /** 077 * Tests whether this is a reply. 078 * 079 * @return whether this is a reply. 080 */ 081 boolean subjectIsReply(); 082}