public class SearchFilter extends Object
Modifier and Type | Field and Description |
---|---|
private static int |
HASH_CODE_SEED
hash code seed.
|
private Map<String,Object> |
parameters
filter parameters.
|
private String |
searchFilter
filter.
|
Constructor and Description |
---|
SearchFilter()
Default constructor.
|
SearchFilter(String filter)
Creates a new search filter with the supplied filter.
|
SearchFilter(String filter,
Object[] params)
Creates a new search filter with the supplied filter and parameters.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
encode(Object obj)
Hex encodes the supplied object if it is of type byte[], otherwise the string format of the object is escaped.
|
static String |
encodeValue(byte[] value)
Hex encodes the supplied byte array for use in a search filter.
|
static String |
encodeValue(String value)
Encodes the supplied attribute value for use in a search filter.
|
boolean |
equals(Object o) |
private static String |
escape(String s)
Escapes the supplied string per RFC 2254.
|
String |
format()
Returns this filter with it's parameters encoded and replaced.
|
String |
getFilter()
Gets the filter.
|
Map<String,Object> |
getParameters()
Gets the filter parameters.
|
int |
hashCode() |
void |
setFilter(String filter)
Sets the filter.
|
void |
setParameter(int position,
Object value)
Sets a positional filter parameter.
|
void |
setParameter(String name,
Object value)
Sets a named filter parameter.
|
void |
setParameters(Object[] values)
Sets positional filter parameters.
|
String |
toString() |
private static final int HASH_CODE_SEED
private String searchFilter
public SearchFilter()
public SearchFilter(String filter)
filter
- to setpublic String getFilter()
public void setFilter(String filter)
filter
- to setpublic Map<String,Object> getParameters()
public void setParameter(int position, Object value)
position
- of the parameter in the filtervalue
- to setpublic void setParameter(String name, Object value)
name
- of the parameter in the filtervalue
- to setpublic void setParameters(Object[] values)
values
- to setpublic String format()
encode(Object)
.public static String encodeValue(byte[] value)
value
- to encodepublic static String encodeValue(String value)
escape(String)
.value
- to encodeprotected static String encode(Object obj)
escape(String)
.obj
- to encodeprivate static String escape(String s)
s
- to escapeCopyright © 2003-2019 Virginia Tech. All Rights Reserved.