Class SubstringFilter
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.search.Filter
-
- org.apache.directory.api.ldap.codec.search.SubstringFilter
-
public class SubstringFilter extends Filter
A Object that stores the substring filter. A substring filter follow this grammar : substring = attr "=" ( ([initial] any [final] | (initial [any] [final) | ([initial] [any] final) ) initial = value any = "*" *(value "*") final = value- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from class org.apache.directory.api.ldap.codec.search.Filter
parent, parentTlvId, tlvId
-
-
Constructor Summary
Constructors Constructor Description SubstringFilter()The constructor.SubstringFilter(int tlvId)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnySubstrings(String any)Add a internal substringintcomputeLength()Compute the SubstringFilter length
SubstringFilter :ByteBufferencode(ByteBuffer buffer)Encode the Substrings Filter to a PDU.List<String>getAnySubstrings()Get the internal substringsStringgetFinalSubstrings()Get the final substringStringgetInitialSubstrings()Get the initial substringintgetSubstringsLength()StringgetType()Get the attributevoidsetFinalSubstrings(String finalSubstrings)Set the final substringvoidsetInitialSubstrings(String initialSubstrings)Set the initial substringvoidsetSubstringsLength(int substringsLength)voidsetType(String type)Set the attribute to matchStringtoString()Return a string compliant with RFC 2254 representing a Substring filter-
Methods inherited from class org.apache.directory.api.ldap.codec.search.Filter
getParent, getParentTlvId, getTlvId, setParent
-
-
-
-
Constructor Detail
-
SubstringFilter
public SubstringFilter(int tlvId)
The constructor. We will create the 'any' subsring arraylist with only one element.- Parameters:
tlvId- The TLV identifier
-
SubstringFilter
public SubstringFilter()
The constructor. We will create the 'any' subsring arraylist with only one element.
-
-
Method Detail
-
getAnySubstrings
public List<String> getAnySubstrings()
Get the internal substrings- Returns:
- Returns the anySubstrings.
-
addAnySubstrings
public void addAnySubstrings(String any)
Add a internal substring- Parameters:
any- The anySubstrings to set.
-
getFinalSubstrings
public String getFinalSubstrings()
Get the final substring- Returns:
- Returns the finalSubstrings.
-
setFinalSubstrings
public void setFinalSubstrings(String finalSubstrings)
Set the final substring- Parameters:
finalSubstrings- The finalSubstrings to set.
-
getInitialSubstrings
public String getInitialSubstrings()
Get the initial substring- Returns:
- Returns the initialSubstrings.
-
setInitialSubstrings
public void setInitialSubstrings(String initialSubstrings)
Set the initial substring- Parameters:
initialSubstrings- The initialSubstrings to set.
-
getType
public String getType()
Get the attribute- Returns:
- Returns the type.
-
setType
public void setType(String type)
Set the attribute to match- Parameters:
type- The type to set.
-
getSubstringsLength
public int getSubstringsLength()
- Returns:
- Returns the substringsLength.
-
setSubstringsLength
public void setSubstringsLength(int substringsLength)
- Parameters:
substringsLength- The substringsLength to set.
-
computeLength
public int computeLength()
Compute the SubstringFilter length
SubstringFilter :0xA4 L1 | +--> 0x04 L2 type +--> 0x30 L3 | [+--> 0x80 L4 initial] [+--> 0x81 L5-1 any] [+--> 0x81 L5-2 any] [+--> ... [+--> 0x81 L5-i any] [+--> ... [+--> 0x81 L5-n any] [+--> 0x82 L6 final]- Specified by:
computeLengthin classFilter- Returns:
- The encoded length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the Substrings Filter to a PDU.
Substrings Filter :0xA4 LL 0x30 LL substringsFilter 0x04 LL type 0x30 LL substrings sequence | 0x80 LL initial | / [0x81 LL any]* |/ [0x82 LL final] +--[0x81 LL any]+ \ [0x82 LL final] \ 0x82 LL final- Specified by:
encodein classFilter- Parameters:
buffer- The buffer where to put the PDU- Returns:
- The PDU.
- Throws:
EncoderException- If the encoding failed
-
-