KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > vlib > ejb > MasterQueryParameters


1 // Copyright 2004 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.vlib.ejb;
16
17 import java.io.Serializable JavaDoc;
18
19 import org.apache.commons.lang.builder.ToStringBuilder;
20
21 /**
22  * Bundles up the parameters for the
23  * {@link org.apache.tapestry.vlib.ejb.IBookQuery#masterQuery(MasterQueryParameters, SortOrdering)}.
24  *
25  * @author Howard Lewis Ship
26  * @version $Id: MasterQueryParameters.java,v 1.4 2004/02/19 17:37:39 hlship Exp $
27  * @since 3.0
28  *
29  **/

30
31 public class MasterQueryParameters implements Serializable JavaDoc
32 {
33     private static final long serialVersionUID = 557672936915184047L;
34     
35     private String JavaDoc _title;
36     private String JavaDoc _author;
37     private Integer JavaDoc _ownerId;
38     private Integer JavaDoc _publisherId;
39     
40     public MasterQueryParameters(String JavaDoc title, String JavaDoc author, Integer JavaDoc ownerId, Integer JavaDoc publisherId)
41     {
42         _title = title;
43         _author = author;
44         _ownerId = ownerId;
45         _publisherId = publisherId;
46     }
47
48     /**
49      * Returns a substring to match (caselessly) against
50      * {@link IBook#getAuthor()}.
51      *
52      **/

53     
54     public String JavaDoc getAuthor()
55     {
56         return _author;
57     }
58
59     /**
60      * Returns a publisher Id to match, or null
61      * for no publisher constraint.
62      *
63      **/

64
65     public Integer JavaDoc getPublisherId()
66     {
67         return _publisherId;
68     }
69
70     /**
71      * Returns a substring to match
72      * caselessly against the book title.
73      *
74      **/

75      
76     public String JavaDoc getTitle()
77     {
78         return _title;
79     }
80     
81     public Integer JavaDoc getOwnerId()
82     {
83         return _ownerId;
84     }
85
86     public String JavaDoc toString()
87     {
88         ToStringBuilder builder = new ToStringBuilder(this);
89         builder.append("title", _title);
90         builder.append("author", _author);
91         builder.append("ownerId", _ownerId);
92         builder.append("publisherId", _publisherId);
93         
94         return builder.toString();
95     }
96 }
97
Popular Tags