@ThreadSafe
@Immutable
public class InetAddressMatcher
extends java.lang.Object
| Constructor and Description |
|---|
InetAddressMatcher(java.net.InetAddress address,
int bits) |
InetAddressMatcher(java.lang.String host,
int bits) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
buildMaskFrom(byte[] address,
int lastMaskedBits) |
protected java.net.InetAddress |
buildMaskFrom(java.net.InetAddress address,
int lastMaskedBits) |
boolean |
equals(java.lang.Object o) |
java.net.InetAddress |
getAddress() |
int |
getBits() |
java.net.InetAddress |
getMask() |
int |
hashCode() |
static InetAddressMatcher |
matcher(java.net.InetAddress address) |
static InetAddressMatcher |
matcher(java.net.InetAddress address,
int bits) |
static InetAddressMatcher |
matcher(java.lang.String host) |
static InetAddressMatcher |
matcher(java.lang.String host,
int bits) |
boolean |
matches(byte[] address) |
protected boolean |
matches(byte[] left,
byte[] right) |
boolean |
matches(java.net.InetAddress that) |
boolean |
matches(java.lang.String host) |
protected static java.net.InetAddress |
resolveHost(java.lang.String host) |
java.lang.String |
toString() |
public InetAddressMatcher(@Nonnull
java.lang.String host,
@Nonnegative
int bits)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic InetAddressMatcher(@Nonnull
java.net.InetAddress address,
@Nonnegative
int bits)
@Nonnull public static InetAddressMatcher matcher(@Nonnull java.lang.String host) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException@Nonnull public static InetAddressMatcher matcher(@Nonnull java.lang.String host, @Nonnegative int bits) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException@Nonnull public static InetAddressMatcher matcher(@Nonnull java.net.InetAddress address) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException@Nonnull public static InetAddressMatcher matcher(@Nonnull java.net.InetAddress address, @Nonnegative int bits) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic boolean matches(@Nullable
java.lang.String host)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic boolean matches(@Nullable
java.net.InetAddress that)
public boolean matches(@Nullable
byte[] address)
protected boolean matches(@Nonnull
byte[] left,
@Nonnull
byte[] right)
@Nonnull public java.net.InetAddress getAddress()
@Nonnegative public int getBits()
@Nonnull public java.net.InetAddress getMask()
@Nonnull
protected java.net.InetAddress buildMaskFrom(@Nonnull
java.net.InetAddress address,
@Nonnegative
int lastMaskedBits)
@Nonnull
protected byte[] buildMaskFrom(@Nonnull
byte[] address,
@Nonnegative
int lastMaskedBits)
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object@Nonnull
protected static java.net.InetAddress resolveHost(@Nonnull
java.lang.String host)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionCopyright © 2016 echocat. All Rights Reserved.