001package votorola.g.web.wic; // Copyright 2008, 2012, Michael Allan.  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Votorola Software"), to deal in the Votorola Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Votorola Software, and to permit persons to whom the Votorola Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Votorola Software. THE VOTOROLA SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE VOTOROLA SOFTWARE OR THE USE OR OTHER DEALINGS IN THE VOTOROLA SOFTWARE.
002
003import org.apache.wicket.*;
004import org.apache.wicket.request.mapper.parameter.PageParameters;
005import votorola.g.lang.*;
006
007
008/** The link particulars of a bookmarkable page, namely the page class and parameters.
009  */
010public @ThreadSafe final class Bookmark implements java.io.Serializable
011{
012
013    private static final long serialVersionUID = 0L;
014
015
016
017    /** Constructs a Bookmark for a page without parameters.
018      *
019      *     @see #pageClass()
020      */
021    public Bookmark( Class<? extends Page> _pageClass ) { this( _pageClass, null ); }
022
023
024
025    /** Constructs a Bookmark.
026      *
027      *     @see #pageClass()
028      *     @see #parameters()
029      */
030    public Bookmark( Class<? extends Page> _pageClass, PageParameters _pP )
031    {
032        pageClass = _pageClass;
033        parameters = _pP;
034    }
035
036
037
038   // ------------------------------------------------------------------------------------
039
040
041    /** The class of the bookmarkable page.
042      *
043      *     @see org.apache.wicket.markup.html.link.BookmarkablePageLink#BookmarkablePageLink(String,Class)
044      */
045    public Class<? extends Page> pageClass() { return pageClass; }
046
047
048        private final Class<? extends Page> pageClass;
049
050
051
052    /** The parameters of the bookmarkable page, or null if it has none.
053      *
054      *     @see org.apache.wicket.markup.html.link.BookmarkablePageLink#BookmarkablePageLink(String,Class,PageParameters)
055      */
056    public PageParameters parameters() { return parameters; }
057
058
059        private final PageParameters parameters;
060
061
062
063}