Package org.opennms.core.utils
Class IPLike
- java.lang.Object
-
- org.opennms.core.utils.IPLike
-
public abstract class IPLike extends java.lang.Object
IPLike class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Constructor Summary
Constructors Constructor Description IPLike()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
countChar(char charIn, java.lang.String stingIn)
countCharstatic boolean
matches(java.lang.String address, java.lang.String pattern)
matchesstatic boolean
matches(java.net.InetAddress address, java.lang.String pattern)
static boolean
matchNumericListOrRange(java.lang.String value, java.lang.String patterns)
static boolean
matchNumericListOrRange(java.lang.String value, java.lang.String patterns, org.opennms.core.utils.IPLike.RangeMatcher matcher)
Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or portsstatic boolean
matchRange(java.lang.String value, java.lang.String pattern)
Helper method in support of matchNumericListOrRangestatic boolean
matchRangeHex(java.lang.String value, java.lang.String pattern)
Helper method in support of matchNumericListOrRange
-
-
-
Method Detail
-
matches
public static boolean matches(java.net.InetAddress address, java.lang.String pattern)
-
matches
public static boolean matches(java.lang.String address, java.lang.String pattern)
matches
- Parameters:
address
- aString
object.pattern
- aString
object.- Returns:
- a boolean.
-
matchNumericListOrRange
public static boolean matchNumericListOrRange(java.lang.String value, java.lang.String patterns)
-
matchNumericListOrRange
public static boolean matchNumericListOrRange(java.lang.String value, java.lang.String patterns, org.opennms.core.utils.IPLike.RangeMatcher matcher)
Use this method to match ranges, lists, and specific number strings such as: "200-300" or "200,300,501-700" "*" matches any This method is commonly used for matching IP octets or ports- Parameters:
value
- aString
object.patterns
- aString
object.- Returns:
- a boolean.
-
matchRange
public static boolean matchRange(java.lang.String value, java.lang.String pattern)
Helper method in support of matchNumericListOrRange- Parameters:
value
- aString
object.pattern
- aString
object.- Returns:
- a boolean.
-
matchRangeHex
public static boolean matchRangeHex(java.lang.String value, java.lang.String pattern)
Helper method in support of matchNumericListOrRange- Parameters:
value
- aString
object.pattern
- aString
object.- Returns:
- a boolean.
-
countChar
public static int countChar(char charIn, java.lang.String stingIn)
countChar
- Parameters:
charIn
- a char.stingIn
- aString
object.- Returns:
- a int.
-
-