Package org.gnome.gio
Class InetAddressMask
java.lang.Object
org.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.- Since:
- 2.32
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInetAddressMask.Builder<B extends InetAddressMask.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gio.Initable
Initable.Initable$Impl, Initable.InitableIface -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new InetAddressMask.InetAddressMask(MemorySegment address) Create a InetAddressMask proxy instance for the provided memory address.InetAddressMask(InetAddress addr, int length) Creates a newGInetAddressMaskrepresenting all addresses whose firstlengthbits matchaddr. -
Method Summary
Modifier and TypeMethodDescriptionprotected InetAddressMaskasParent()Returns this instance as if it were its parent type.static InetAddressMask.Builder<? extends InetAddressMask.Builder> builder()AInetAddressMask.Builderobject constructs aInetAddressMaskwith the specified properties.booleanequal(InetAddressMask mask2) Tests if this InetAddressMask andmask2are the same mask.static InetAddressMaskfromString(String maskString) ParsesmaskStringas an IP address and (optional) length, and creates a newGInetAddressMask.Getsmask'sbase addressGets theGSocketFamilyofmask'saddressintGetsmask'slengthstatic MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the InetAddressMask classbooleanmatches(InetAddress address) Tests ifaddressfalls within the range described bymask.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, 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, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.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 newGInetAddressMaskrepresenting all addresses whose firstlengthbits matchaddr.- Parameters:
addr- aGInetAddresslength- number of bits ofaddrto use- Throws:
GErrorException- seeGError- Since:
- 2.32
-
InetAddressMask
public InetAddressMask()Creates a new InetAddressMask.
-
-
Method Details
-
getType
Get the GType of the InetAddressMask class- Returns:
- the GType
-
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 Javasuperkeyword, 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
ParsesmaskStringas 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
GInetAddressMaskcorresponding tostring,ornullon error. - Throws:
GErrorException- seeGError- Since:
- 2.32
-
equal
Tests if this InetAddressMask andmask2are the same mask.- Parameters:
mask2- anotherGInetAddressMask- Returns:
- whether this InetAddressMask and
mask2are the same mask - Since:
- 2.32
-
getAddress
-
getFamily
Gets theGSocketFamilyofmask'saddress- Returns:
- the
GSocketFamilyofmask'saddress - Since:
- 2.32
-
getLength
public int getLength()Getsmask'slength- Returns:
mask'slength- Since:
- 2.32
-
matches
Tests ifaddressfalls within the range described bymask.- Parameters:
address- aGInetAddress- Returns:
- whether
addressfalls within the range described bymask. - Since:
- 2.32
-
toString
-
builder
AInetAddressMask.Builderobject constructs aInetAddressMaskwith the specified properties. Use the variousset...()methods to set properties, and finish construction withInetAddressMask.Builder.build().- Returns:
- the builder object
-