public final class UtilsCidr extends Object
It provides static functions to escape unescape, trim or removing leading?trailing quotes out of String.
It also provide additional utility functions, handy to make them unit tested.
Modifier and Type | Method and Description |
---|---|
static String |
getCidrFieldKey(Tuple t)
Given a tuple, return the key of the first element that match a CIDR format.
|
static com.github.veqryn.collect.Trie<com.github.veqryn.net.Cidr4,Tuple> |
getCidrTrie(Tuple resource,
String cidrField)
Given an input resource tuple, return a CIDR Trie structure.
|
static com.github.veqryn.collect.Trie<com.github.veqryn.net.Cidr4,Long> |
getCompactCidrTrie(org.thales.punch.libraries.punchlang.impl.operator.CompactCsv resource,
String cidrField) |
public static String getCidrFieldKey(Tuple t)
This function is inefficient. Use if only to build things at startup.
t
- the input tuple.public static com.github.veqryn.collect.Trie<com.github.veqryn.net.Cidr4,Tuple> getCidrTrie(Tuple resource, String cidrField)
The resource tuple MUST be an array.
resource
- the input resource tuplecidrField
- the tuple field key that must be used as CIDR. You can pass null, in which case the first
tuple field that matches a CIDR will be used.PunchRuntimeException
- in case of errorpublic static com.github.veqryn.collect.Trie<com.github.veqryn.net.Cidr4,Long> getCompactCidrTrie(org.thales.punch.libraries.punchlang.impl.operator.CompactCsv resource, String cidrField)
resource
- your input compact csvcidrField
- the columnsCopyright © 2022. All rights reserved.