Skip to content

Package: SearchTerm

SearchTerm

nameinstructionbranchcomplexitylinemethod
SearchTerm()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail.search;
18:
19: import java.io.Serializable;
20:
21: import jakarta.mail.Message;
22:
23: /**
24: * Search criteria are expressed as a tree of search-terms, forming
25: * a parse-tree for the search expression. <p>
26: *
27: * Search-terms are represented by this class. This is an abstract
28: * class; subclasses implement specific match methods. <p>
29: *
30: * Search terms are serializable, which allows storing a search term
31: * between sessions.
32: *
33: * <strong>Warning:</strong>
34: * Serialized objects of this class may not be compatible with future
35: * Jakarta Mail API releases. The current serialization support is
36: * appropriate for short term storage. <p>
37: *
38: * @author Bill Shannon
39: * @author John Mani
40: */
41: public abstract class SearchTerm implements Serializable {
42:
43: private static final long serialVersionUID = -6652358452205992789L;
44:
45: /**
46: * Creates a default {@code SearchTerm}.
47: */
48: public SearchTerm() {
49: }
50:
51: /**
52: * This method applies a specific match criterion to the given
53: * message and returns the result.
54: *
55: * @param msg        The match criterion is applied on this message
56: * @return                true, it the match succeeds, false if the match fails
57: */
58:
59: public abstract boolean match(Message msg);
60: }