Package com.germinus.easyconf

# Class Filter

java.lang.Object
com.germinus.easyconf.Filter

public class Filter extends Object
Builds filters from arrays of strings or up to three string paramters

Author:
  jferrer

## Field Summary

Fields
Modifier and Type
Field
Description
`private String[]`
`selectors`
`private Map`
`variables`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`Filter(String[] selectors)`
`private`
`Filter(Map variables)`

## Method Summary

Modifier and Type
Method
Description
`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(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)`
`static Filter`
`usingVariables(Map vars)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### selectors

private String[] selectors

### variables

private Map variables

## Constructor Details

### Filter

private Filter(String[] selectors)

### Filter

private Filter(Map variables)

## Method Details

### 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 invalid input: '<' 1 or n > size()

### toString

public String toString()

Overrides:
  `toString` in class `Object`