Stdlib index
- Captured-borrow migration worklist (3.3.3)
- Owned-bind migration worklist (8.2.7)
- Return-side title audit — the ride-through enumeration
- stdlib ownership audit
- stdlib ownership dispositions (plan 1.3.1 / 4.3.1)
aot
codec
codec / csv
codec / json
collection
- ArrayList
- BPlusTree
- Cache
- Collectors
- HashMap
- HashSet
- Heap
- ImmutableList
- ImmutableMap
- ImmutableSet
- LinkedList
- RedBlackTree
- Sort
collection / ltm
concurrent
error
- Exception
- NoOptionalValueException
- NotProvidedException
- RecoverableException
- ScopedBuildFailedException
- ScopeNotActiveException
- Throwable
- UnrecoverableException
gfx
hash
ifx
io
io / file
io / net
io / net / dns
io / net / uri
lang
lang / stream
math
math / fft
math / linalg
math / npio
math / poly
math / random
math / stats
nucleo
- Columns — the Arrow-laid-out substrate
- Fused tensor expressions — Fuse
- Table — the lazy, typed dataframe
- Tape — define-by-run autograd
- Transform intrinsics — Grad, Vmap, Jit
process
reflect
search / distance
search / fuzzy
search / ngram
session
time
- Clock
- DateTimeFormatter
- Duration
- Instant
- LocalDate
- LocalDateTime
- LocalTime
- Period
- ZonedDateTime
- ZoneId
- ZoneOffset
wire
xpu
xpu / mesh
IpAddress
cajeta.io.net.IpAddress — an immutable IP address, IPv4 or IPv6, with text
parse and canonical toString. The address is held as a 16-byte octet array
in network byte order regardless of family (IPv4 uses the first four bytes).
parse auto-detects the family and is strict — a malformed octet or group, an
out-of-range value, a doubled ::, or trailing junk raises a citing
MalformedAddressException. toString reproduces the canonical form: IPv4
dotted-quad, IPv6 per RFC 5952, so parse(s).toString() round-trips a
canonical input byte-identically.
IpAddress a #= IpAddress.parse("192.168.1.10");
IpAddress b #= IpAddress.fromV4(192, 168, 1, 10);
boolean same = a.equals(b); // true
IpAddress lo #= IpAddress.loopbackV4();
String text #= lo.toString(); // "127.0.0.1"
Methods
| Signature | |
|---|---|
IpAddress() | The unspecified IPv4 0.0.0.0 (all-zero octets, family V4) |
AddressFamily getFamily() | This address’s family (V4 or V6) |
boolean isV4() | True iff IPv4 |
boolean isV6() | True iff IPv6 |
int8[] getOctets() | The raw 16-byte octet buffer (network byte order) |
static #IpAddress loopbackV4() | The IPv4 loopback 127.0.0.1 |
static #IpAddress loopbackV6() | The IPv6 loopback ::1 |
static #IpAddress anyV4() | The IPv4 wildcard 0.0.0.0 |
static #IpAddress anyV6() | The IPv6 wildcard :: |
static #IpAddress fromV4(int32 a0, int32 a1, int32 a2, int32 a3) ⚑ | Build directly from four octet values (a.b.c.d) |
static #IpAddress fromOctets(int8[] src, int32 len) | Build from a 4-byte (v4) or 16-byte (v6) octet buffer — the inverse of getOctets |
boolean equals(IpAddress other) | Equal iff same family and the family-relevant octets match |
static #IpAddress parse(String input) ⚑ | Parse dotted-quad or IPv6 text (incl. :: compression and the embedded-IPv4 tail form) |
#String toString() | Canonical text: IPv4 dotted-quad, IPv6 per RFC 5952 |
⚑ = @EntryPoint
See also
- Tour: NetDemo
- Source:
runtime/src/cajeta/io/net/IpAddress.cajeta - SocketAddress — an
IpAddresspaired with a port