public class Masked<T extends OFValueType<T>> extends Object implements OFValueType<Masked<T>>
| Modifier and Type | Field and Description |
|---|---|
protected T |
mask
bitmask of the value.
|
protected T |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
Masked(T value,
T mask) |
| Modifier and Type | Method and Description |
|---|---|
Masked<T> |
applyMask(Masked<T> mask) |
int |
compareTo(Masked<T> o) |
boolean |
equals(Object obj) |
int |
getLength() |
T |
getMask() |
T |
getValue() |
int |
hashCode() |
boolean |
matches(T candidate)
Determine whether candidate value is matched by this masked value
(i.e., does candiate lie in the 'network/range' specified by this masked
value).
|
static <T extends OFValueType<T>> |
of(T value,
T mask) |
void |
putTo(com.google.common.hash.PrimitiveSink sink)
Dump the state of this object into a
PrimitiveSink (e.g., a Hasher) for the purpose
of computing a strong hash. |
String |
toString() |
protected final T extends OFValueType<T> value
protected final T extends OFValueType<T> mask
public T getValue()
public T getMask()
public static <T extends OFValueType<T>> Masked<T> of(T value, T mask)
public int getLength()
getLength in interface OFValueType<Masked<T extends OFValueType<T>>>public boolean matches(T candidate)
candidate - the candidate value to testpublic Masked<T> applyMask(Masked<T> mask)
applyMask in interface OFValueType<Masked<T extends OFValueType<T>>>public int compareTo(Masked<T> o)
compareTo in interface Comparable<Masked<T extends OFValueType<T>>>public void putTo(com.google.common.hash.PrimitiveSink sink)
PrimitiveSinkablePrimitiveSink (e.g., a Hasher) for the purpose
of computing a strong hash.
Equality contract:
Equal objects must dump the equal data into the sink, non-equal objects must dump different
data into the sink. Please see the interface documentation of PrimitiveSink for more
details and caveats/traps.putTo in interface PrimitiveSinkablesink - the sink to dump the object state into.Copyright © 2021. All rights reserved.