Package org.gnome.gio
Class InetAddressMask
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.gio.InetAddressMask
@Generated("io.github.jwharm.JavaGI")
public class InetAddressMask
extends GObject
implements Initable
GInetAddressMask
represents a range of IPv4 or IPv6 addresses
described by a base address and a length indicating how many bits
of the base address are relevant for matching purposes. These are
often given in string form. For example, 10.0.0.0/8
, or fe80::/10
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
InetAddressMask.Builder<B extends InetAddressMask.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
Nested classes/interfaces inherited from interface org.gnome.gio.Initable
Initable.InitableIface, Initable.InitableImpl
-
Constructor Summary
ConstructorDescriptionInetAddressMask
(MemorySegment address) Create a InetAddressMask proxy instance for the provided memory address.InetAddressMask
(InetAddress addr, int length) Creates a newGInetAddressMask
representing all addresses whose firstlength
bits matchaddr
. -
Method Summary
Modifier and TypeMethodDescriptionprotected InetAddressMask
asParent()
Returns this instance as if it were its parent type.static InetAddressMask.Builder
<? extends InetAddressMask.Builder> builder()
AInetAddressMask.Builder
object constructs aInetAddressMask
with the specified properties.boolean
equal
(InetAddressMask mask2) Tests if this InetAddressMask andmask2
are the same mask.static InetAddressMask
fromString
(String maskString) ParsesmaskString
as an IP address and (optional) length, and creates a newGInetAddressMask
.Gets this InetAddressMask's base addressGets theGSocketFamily
of this InetAddressMask's addressint
Gets this InetAddressMask's lengthstatic MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the InetAddressMask classboolean
matches
(InetAddress address) Tests ifaddress
falls within the range described by this InetAddressMask.toString()
Converts this InetAddressMask back to its corresponding string form.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
InetAddressMask
Create a InetAddressMask proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
InetAddressMask
Creates a newGInetAddressMask
representing all addresses whose firstlength
bits matchaddr
.- Parameters:
addr
- aGInetAddress
length
- number of bits ofaddr
to use- Throws:
GErrorException
- seeGError
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
fromString
ParsesmaskString
as an IP address and (optional) length, and creates a newGInetAddressMask
. The length, if present, is delimited by a "/". If it is not present, then the length is assumed to be the full length of the address.- Parameters:
maskString
- an IP address or address/length string- Returns:
- a new
GInetAddressMask
corresponding tostring
, ornull
on error. - Throws:
GErrorException
- seeGError
-
equal
Tests if this InetAddressMask andmask2
are the same mask.- Parameters:
mask2
- anotherGInetAddressMask
- Returns:
- whether this InetAddressMask and
mask2
are the same mask
-
getAddress
Gets this InetAddressMask's base address- Returns:
- this InetAddressMask's base address
-
getFamily
Gets theGSocketFamily
of this InetAddressMask's address- Returns:
- the
GSocketFamily
of this InetAddressMask's address
-
getLength
public int getLength()Gets this InetAddressMask's length- Returns:
- this InetAddressMask's length
-
matches
Tests ifaddress
falls within the range described by this InetAddressMask.- Parameters:
address
- aGInetAddress
- Returns:
- whether
address
falls within the range described by this InetAddressMask.
-
toString
-
builder
AInetAddressMask.Builder
object constructs aInetAddressMask
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withInetAddressMask.Builder.build()
.
-