Class InetAddressMask
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gobject.GObject
org.gnome.gio.InetAddressMask
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 GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface Initable
Initable.Initable$Impl, Initable.InitableIface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new InetAddressMask.InetAddressMask(MemorySegment address) Create a InetAddressMask 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()Return 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 class.booleanmatches(InetAddress address) Tests ifaddressfalls within the range described bymask.toString()Converts this InetAddressMask back to its corresponding string form.Methods inherited from class 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
InetAddressMask
Create a InetAddressMask 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()Create 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
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
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
-