001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.jsp.search.state; 029 030import org.opencms.util.CmsStringUtil; 031 032/** 033 * Interface for the Geo filter state. 034 */ 035public interface I_CmsSearchStateGeoFilter { 036 037 /** 038 * Returns the coordinates. 039 * @return the coordinates 040 */ 041 String getCoordinates(); 042 043 /** 044 * Returns the radius. 045 * @return the radius 046 */ 047 String getRadius(); 048 049 /** 050 * Returns the units. 051 * @return the units 052 */ 053 String getUnits(); 054 055 /** 056 * Returns whether we are in a Geo filter state or not. 057 * @return whether we are in a Geo filter state or not 058 */ 059 default boolean hasGeoFilter() { 060 061 return !CmsStringUtil.isEmptyOrWhitespaceOnly(getCoordinates()) 062 && !CmsStringUtil.isEmptyOrWhitespaceOnly(getRadius()); 063 } 064 065 /** 066 * Sets the coordinates. 067 * @param coordinates the coordinates 068 */ 069 void setCoordinates(String coordinates); 070 071 /** 072 * Sets the radius. 073 * @param radius the radius 074 */ 075 void setRadius(String radius); 076 077 /** 078 * Sets the units. 079 * @param the units 080 */ 081 void setUnits(String units); 082}