org.gcube.portlets.user.homelibrary.util.config.easyconf
Class Filter
java.lang.Object
org.gcube.portlets.user.homelibrary.util.config.easyconf.Filter
public class Filter
- extends Object
Builds filters from arrays of strings or up to three string paramters
- Author:
- jferrer
|
Method Summary |
static Filter |
by(String first)
|
static Filter |
by(String[] selectors)
|
static Filter |
by(String first,
String second)
|
static Filter |
by(String first,
String second,
String third)
|
String |
getFilterSuffix(int n)
Get a fragment of the filter which includes the first 'n' selectors
concatenated. |
String[] |
getSelectors()
|
Map |
getVariables()
|
boolean |
hasVariables()
|
int |
numOfSelectors()
|
Filter |
setSelectors(String[] newSelectors)
|
Filter |
setVariables(Map newVars)
|
String |
toString()
|
static Filter |
usingVariables(Map vars)
|
static Filter |
usingVariables(String var1,
String value1)
|
static Filter |
usingVariables(String var1,
String value1,
String var2,
String value2)
|
static Filter |
usingVariables(String var1,
String value1,
String var2,
String value2,
String var3,
String value3)
|
by
public static Filter by(String first)
by
public static Filter by(String first,
String second)
by
public static Filter by(String first,
String second,
String third)
by
public static Filter by(String[] selectors)
usingVariables
public static Filter usingVariables(String var1,
String value1)
usingVariables
public static Filter usingVariables(String var1,
String value1,
String var2,
String value2)
usingVariables
public static Filter usingVariables(String var1,
String value1,
String var2,
String value2,
String var3,
String value3)
usingVariables
public static Filter usingVariables(Map vars)
hasVariables
public boolean hasVariables()
setVariables
public Filter setVariables(Map newVars)
getVariables
public Map getVariables()
getSelectors
public String[] getSelectors()
setSelectors
public Filter setSelectors(String[] newSelectors)
numOfSelectors
public int numOfSelectors()
getFilterSuffix
public String getFilterSuffix(int n)
- Get a fragment of the filter which includes the first 'n' selectors
concatenated.
Example: if the filter has two selectors (bar and foo). Fragments would
be:
- For n=2: "[bar][foo]"
- For n=1: "[bar]"
- For n=0: ""
- Otherwise: throws IllegalArgumentException
- Parameters:
n -
- Returns:
-
- Throws:
IllegalArgumentException - if n < 1 or n > size()
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2013. All Rights Reserved.