Class InetAddress.Builder<B extends InetAddress.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
InetAddress

public static class InetAddress.Builder<B extends InetAddress.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public InetAddress build()
      Finish building the InetAddress object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to InetAddress.
      Overrides:
      build in class GObject.Builder<B extends InetAddress.Builder<B>>
      Returns:
      a new instance of InetAddress with the properties that were set in the Builder object.
    • setBytes

      public B setBytes(MemorySegment bytes)
      The raw address data.
      Parameters:
      bytes - the value for the bytes property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.22
    • setFamily

      public B setFamily(SocketFamily family)
      The address family (IPv4 or IPv6).
      Parameters:
      family - the value for the family property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.22
    • setFlowinfo

      public B setFlowinfo(int flowinfo)
      The flowinfo for an IPv6 address. See InetAddress.getFlowinfo().
      Parameters:
      flowinfo - the value for the flowinfo property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.86
    • setScopeId

      public B setScopeId(int scopeId)
      The scope-id for an IPv6 address. See InetAddress.getScopeId().
      Parameters:
      scopeId - the value for the scope-id property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      2.86